4dddc56c4c4b

Use @registrar.command where available (hg 3.7+).
[view raw] [browse files]
author Kevin Bullock <kbullock@ringworld.org>
date Fri, 20 Oct 2017 10:51:53 -0500
parents 5334581e231a
children dc481ce24b60
branches/tags (none)
files prompt.py

Changes

diff -r 5334581e231a -r 4dddc56c4c4b prompt.py
--- a/prompt.py	Wed Oct 05 20:52:29 2016 +0000
+++ b/prompt.py	Fri Oct 20 10:51:53 2017 -0500
@@ -20,8 +20,13 @@
 from mercurial.i18n import _
 from mercurial.node import hex, short
 
+# command registration moved into `registrar` module in v3.7.
 cmdtable = {}
-command = cmdutil.command(cmdtable)
+try:
+    from mercurial import registrar
+    command = registrar.command(cmdtable)
+except ImportError:
+    command = cmdutil.command(cmdtable)
 
 # `revrange' has been moved into module `scmutil' since v1.9.
 try :