wrapcommand: fix wrapping extensions that aren't enabled
The extension command wrapping would previously fail if the extension wasn't
enabled. Let's just eat that silently.
--- a/hgext/evolve.py Thu Mar 19 10:52:28 2015 -0700
+++ b/hgext/evolve.py Thu Mar 19 12:32:32 2015 -0700
@@ -168,9 +168,12 @@
templatekw.keywords[name] = kw
for ext, command, wrapper, opts in self._extcommandwrappers:
if ext not in knownexts:
- e = extensions.find(ext)
- if e is None:
- raise util.Abort('extension %s not found' % ext)
+ try:
+ e = extensions.find(ext)
+ except KeyError:
+ # Extension isn't enabled, so don't bother trying to wrap
+ # it.
+ continue
knownexts[ext] = e.cmdtable
entry = extensions.wrapcommand(knownexts[ext], command, wrapper)
if opts: