changeset 1021: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 d356f8479295
children 17f64b9bfa62
files hggit/__init__.py tests/commitextra.py
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hggit/__init__.py
+++ b/hggit/__init__.py
@@ -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
--- a/tests/commitextra.py
+++ b/tests/commitextra.py
@@ -3,7 +3,11 @@
 from mercurial import cmdutil, commands, scmutil
 
 cmdtable = {}
-command = cmdutil.command(cmdtable)
+try:
+    from mercurial import registrar
+    command = registrar.command(cmdtable)
+except (ImportError, AttributeError):
+    command = cmdutil.command(cmdtable)
 testedwith = 'internal'
 
 @command('commitextra',