diff -r 890845af1ac2 -r e6e7d1cce04d mercurial/extensions.py --- a/mercurial/extensions.py Mon May 04 10:17:34 2015 +0900 +++ b/mercurial/extensions.py Wed May 06 09:52:10 2015 -0700 @@ -134,6 +134,10 @@ for fn in _aftercallbacks[shortname]: fn(loaded=False) + # loadall() is called multiple times and lingering _aftercallbacks + # entries could result in double execution. See issue4646. + _aftercallbacks.clear() + def afterloaded(extension, callback): '''Run the specified function after a named extension is loaded.