extensions: rename _ignore to _builtin, add descriptive comment
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 24 Nov 2015 16:38:54 -0800
changeset 27111 9de814b35808
parent 27110 f04bd381e8c0
child 27112 39c14e89b881
extensions: rename _ignore to _builtin, add descriptive comment It was previously not at all obvious what this was for. We also change it to a set to avoid iterating over an admittedly small list repeatedly at startup time.
mercurial/extensions.py
--- a/mercurial/extensions.py	Sun Nov 22 14:44:55 2015 -0800
+++ b/mercurial/extensions.py	Tue Nov 24 16:38:54 2015 -0800
@@ -24,7 +24,8 @@
 _extensions = {}
 _aftercallbacks = {}
 _order = []
-_ignore = ['hbisect', 'bookmarks', 'parentrevspec', 'interhg', 'inotify']
+#  former extensions now in core - we ignore these if found in hgrc
+_builtin = set(['hbisect', 'bookmarks', 'parentrevspec', 'interhg', 'inotify'])
 
 def extensions(ui=None):
     if ui:
@@ -75,7 +76,7 @@
         shortname = name[6:]
     else:
         shortname = name
-    if shortname in _ignore:
+    if shortname in _builtin:
         return None
     if shortname in _extensions:
         return _extensions[shortname]