Mercurial > hg
diff mercurial/extensions.py @ 33014:80a5d237a4ae
extensions: call afterloaded() with loaded=False for disabled extensions
If an extension was loaded but disabled due to a minimumhgversion check it
will be present in the _extensions map, but set to None. The rest of the
extensions code treats the extension as if it were not present in this case,
but the afterloaded() function called the callback with loaded=True.
author | Adam Simpkins <simpkins@fb.com> |
---|---|
date | Fri, 23 Jun 2017 10:59:05 -0700 |
parents | ea1c2eb7abd3 |
children | 45b0e9d05ee9 |
line wrap: on
line diff
--- a/mercurial/extensions.py Sat Jun 24 02:39:13 2017 +0900 +++ b/mercurial/extensions.py Fri Jun 23 10:59:05 2017 -0700 @@ -257,7 +257,9 @@ ''' if extension in _extensions: - callback(loaded=True) + # Report loaded as False if the extension is disabled + loaded = (_extensions[extension] is not None) + callback(loaded=loaded) else: _aftercallbacks.setdefault(extension, []).append(callback)