# HG changeset patch # User Manuel Jacob <me@manueljacob.de> # Date 1592003387 -7200 # Sat Jun 13 01:09:47 2020 +0200 # Node ID bec3bd68f01127284b44716f6c116484fc1a4d03 # Parent 39a539c9b789600cbddb5f8fa4b4ad2a7aceff0a compat: reduce code in try clause In the previous code, if lazy-importing compat failed, the except clause was executed, raising a bogus error. diff --git a/hggit/__init__.py b/hggit/__init__.py --- a/hggit/__init__.py +++ b/hggit/__init__.py @@ -77,13 +77,15 @@ from mercurial import registrar command = registrar.command(cmdtable) configitem = registrar.configitem(configtable) - compat.registerconfigs(configitem) templatekeyword = registrar.templatekeyword() except (ImportError, AttributeError): command = cmdutil.command(cmdtable) templatekeyword = compat.templatekeyword() +else: + compat.registerconfigs(configitem) + # support for `hg clone git://github.com/defunkt/facebox.git` # also hg clone git+ssh://git@github.com/schacon/simplegit.git for _scheme in util.gitschemes: