Mercurial > hg-git
diff hggit/__init__.py @ 1020:f2118a7dd764
commands: update to use registrar
Core hg has deprecated cmdutil.commands in favor of registrar.commands. So we
need to update hg-git as well.
author | Durham Goode <durham@fb.com> |
---|---|
date | Mon, 22 May 2017 15:45:54 -0700 |
parents | 715cbf3fa24c |
children | 78959c8e5e60 |
line wrap: on
line diff
--- a/hggit/__init__.py Fri May 12 13:14:21 2017 -0700 +++ b/hggit/__init__.py Mon May 22 15:45:54 2017 -0700 @@ -84,7 +84,11 @@ buglink = 'https://bitbucket.org/durin42/hg-git/issues' cmdtable = {} -command = cmdutil.command(cmdtable) +try: + from mercurial import registrar + command = registrar.command(cmdtable) +except (ImportError, AttributeError): + command = cmdutil.command(cmdtable) # support for `hg clone git://github.com/defunkt/facebox.git` # also hg clone git+ssh://git@github.com/schacon/simplegit.git