changeset 1347:b00c2fe51ac8

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.
author Laurent Charignon <lcharignon@fb.com>
date Fri, 22 May 2015 10:38:16 -0700
parents 9a1415f8b21b
children 14b537042245
files hgext/directaccess.py
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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):