diff mercurial/hg.py @ 19777:6f72e7d28b35

extensions: list up only enabled extensions, if "ui" is specified Before this patch, "extensions.extensions()" always lists up all loaded extensions. So, commands handling multiple repositories at a time like below enable extensions unexpectedly. - clone from or push to localhost: extensions enabled only in the source are enabled also in the destination - pull from localhost: extensions enabled only in the destination are enabled also in the source - recursive execution in subrepo tree: extensions enabled only in the parent or some of siblings in the tree are enabled also in others In addition to it, extensions disabled locally may be enabled unexpectedly. This patch checks whether each of extensions should be listed up or not, if "ui" is specified to "extensions.extensions()", and invokes "reposetup()" of each extensions only for repositories enabling it.
author FUJIWARA Katsunori <foozy@lares.dti.ne.jp>
date Sat, 21 Sep 2013 21:33:29 +0900
parents 648d1974b3f3
children 2d0ab571b822
line wrap: on
line diff
--- a/mercurial/hg.py	Mon Sep 23 11:37:06 2013 -0700
+++ b/mercurial/hg.py	Sat Sep 21 21:33:29 2013 +0900
@@ -101,7 +101,7 @@
     """return a repository object for the specified path"""
     obj = _peerlookup(path).instance(ui, path, create)
     ui = getattr(obj, "ui", ui)
-    for name, module in extensions.extensions():
+    for name, module in extensions.extensions(ui):
         hook = getattr(module, 'reposetup', None)
         if hook:
             hook(ui, obj)