wrapcommand: fix wrapping extensions that aren't enabled
authorDurham Goode <durham@fb.com>
Thu, 19 Mar 2015 12:32:32 -0700
changeset 1219 658b0d032699
parent 1218 dd5e62979100
child 1220 71240f696f26
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.
hgext/evolve.py
--- 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: