comparison hgext/evolve.py @ 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
comparison
equal deleted inserted replaced
1218:dd5e62979100 1219:658b0d032699
166 revset.symbols[name] = symbol 166 revset.symbols[name] = symbol
167 for name, kw in self._templatekws: 167 for name, kw in self._templatekws:
168 templatekw.keywords[name] = kw 168 templatekw.keywords[name] = kw
169 for ext, command, wrapper, opts in self._extcommandwrappers: 169 for ext, command, wrapper, opts in self._extcommandwrappers:
170 if ext not in knownexts: 170 if ext not in knownexts:
171 e = extensions.find(ext) 171 try:
172 if e is None: 172 e = extensions.find(ext)
173 raise util.Abort('extension %s not found' % ext) 173 except KeyError:
174 # Extension isn't enabled, so don't bother trying to wrap
175 # it.
176 continue
174 knownexts[ext] = e.cmdtable 177 knownexts[ext] = e.cmdtable
175 entry = extensions.wrapcommand(knownexts[ext], command, wrapper) 178 entry = extensions.wrapcommand(knownexts[ext], command, wrapper)
176 if opts: 179 if opts:
177 for short, long, val, msg in opts: 180 for short, long, val, msg in opts:
178 entry[1].append((short, long, val, msg)) 181 entry[1].append((short, long, val, msg))