extensions: allow loading a whitelisted subset of extensions
authorJun Wu <quark@fb.com>
Mon, 22 May 2017 00:51:56 -0700
changeset 32416 9a3e88d4a030
parent 32415 9695aca1a3a0
child 32417 f40dc6f7c12f
extensions: allow loading a whitelisted subset of extensions This feature will be used by the next patch.
mercurial/extensions.py
--- a/mercurial/extensions.py	Mon May 22 08:49:34 2017 -0700
+++ b/mercurial/extensions.py	Mon May 22 00:51:56 2017 -0700
@@ -179,8 +179,10 @@
                 raise
             extsetup() # old extsetup with no ui argument
 
-def loadall(ui):
+def loadall(ui, whitelist=None):
     result = ui.configitems("extensions")
+    if whitelist:
+        result = [(k, v) for (k, v) in result if k in whitelist]
     newindex = len(_order)
     for (name, path) in result:
         if path: