Mercurial > hg
diff contrib/perf.py @ 32337:46ba2cdda476
registrar: move cmdutil.command to registrar module (API)
cmdutil.command wasn't a member of the registrar framework only for a
historical reason. Let's make that happen. This patch keeps cmdutil.command
as an alias for extension compatibility.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Sat, 09 Jan 2016 23:07:20 +0900 |
parents | d7efaf6275a7 |
children | 04baab18d60a |
line wrap: on
line diff
--- 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]: