changeset 1219:658b0d032699

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.
author Durham Goode <durham@fb.com>
date Thu, 19 Mar 2015 12:32:32 -0700
parents dd5e62979100
children 71240f696f26
files hgext/evolve.py
diffstat 1 files changed, 6 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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: