directaccess: don't crash when evolve is not loaded
Before this patch, when evolve was not loaded direct access was crashing. This
patch catches the error and prevents the crash.
--- a/hgext/directaccess.py Wed May 20 10:58:32 2015 -0700
+++ b/hgext/directaccess.py Fri May 22 10:38:16 2015 -0700
@@ -47,11 +47,11 @@
branchmap.subsettable['visible-directaccess-warn'] = 'visible'
for warn, ext, cmd in directaccesslevel:
- cmdtable = extensions.find(ext).cmdtable if ext else commands.table
- wrapper = wrapwithwarning if warn else wrapwithoutwarning
try:
+ cmdtable = extensions.find(ext).cmdtable if ext else commands.table
+ wrapper = wrapwithwarning if warn else wrapwithoutwarning
extensions.wrapcommand(cmdtable, cmd, wrapper)
- except error.UnknownCommand:
+ except (error.UnknownCommand, KeyError):
pass
def wrapwithoutwarning(orig, ui, repo, *args, **kwargs):