Mercurial > public > mercurial-scm > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
19776:a9e92b11a3f2 | 19777:6f72e7d28b35 |
---|---|
99 | 99 |
100 def _peerorrepo(ui, path, create=False): | 100 def _peerorrepo(ui, path, create=False): |
101 """return a repository object for the specified path""" | 101 """return a repository object for the specified path""" |
102 obj = _peerlookup(path).instance(ui, path, create) | 102 obj = _peerlookup(path).instance(ui, path, create) |
103 ui = getattr(obj, "ui", ui) | 103 ui = getattr(obj, "ui", ui) |
104 for name, module in extensions.extensions(): | 104 for name, module in extensions.extensions(ui): |
105 hook = getattr(module, 'reposetup', None) | 105 hook = getattr(module, 'reposetup', None) |
106 if hook: | 106 if hook: |
107 hook(ui, obj) | 107 hook(ui, obj) |
108 return obj | 108 return obj |
109 | 109 |