# HG changeset patch # User Laurent Charignon # Date 1432316296 25200 # Node ID b00c2fe51ac8ecb2ef92c5ddab7e45792d87ed07 # Parent 9a1415f8b21b2936aecd030433e6dbc869ebcaaf 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. diff -r 9a1415f8b21b -r b00c2fe51ac8 hgext/directaccess.py --- 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):