contrib/perf.py
changeset 32337 46ba2cdda476
parent 32297 d7efaf6275a7
child 32375 04baab18d60a
--- a/contrib/perf.py	Sat May 13 17:53:55 2017 +0900
+++ b/contrib/perf.py	Sat Jan 09 23:07:20 2016 +0900
@@ -49,6 +49,11 @@
 except ImportError:
     pass
 try:
+    from mercurial import registrar # since 3.7 (or 37d50250b696)
+    dir(registrar) # forcibly load it
+except ImportError:
+    registrar = None
+try:
     from mercurial import repoview # since 2.5 (or 3a6ddacb7198)
 except ImportError:
     pass
@@ -101,7 +106,9 @@
 def parsealiases(cmd):
     return cmd.lstrip("^").split("|")
 
-if safehasattr(cmdutil, 'command'):
+if safehasattr(registrar, 'command'):
+    command = registrar.command(cmdtable)
+elif safehasattr(cmdutil, 'command'):
     import inspect
     command = cmdutil.command(cmdtable)
     if 'norepo' not in inspect.getargspec(command)[0]: