changeset 32416:9a3e88d4a030

extensions: allow loading a whitelisted subset of extensions This feature will be used by the next patch.
author Jun Wu <quark@fb.com>
date Mon, 22 May 2017 00:51:56 -0700
parents 9695aca1a3a0
children f40dc6f7c12f
files mercurial/extensions.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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: