# HG changeset patch # User Yuya Nishihara # Date 2018-10-18 12:14:22 # Node ID 1feb4b2c8e40d427af45a0a8ff46dd58b5291112 # Parent 229d23cdb203f3555facc1beb1dd1fc2369ce144 commands: restore compatibility for "^cmd" registration (issue6005) This is done at loading time, where ui is available. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -6139,6 +6139,16 @@ def version_(ui, **opts): def loadcmdtable(ui, name, cmdtable): """Load command functions from specified cmdtable """ + cmdtable = cmdtable.copy() + for cmd in list(cmdtable): + if not cmd.startswith('^'): + continue + ui.deprecwarn("old-style command registration '%s' in extension '%s'" + % (cmd, name), '4.8') + entry = cmdtable.pop(cmd) + entry[0].helpbasic = True + cmdtable[cmd[1:]] = entry + overrides = [cmd for cmd in cmdtable if cmd in table] if overrides: ui.warn(_("extension '%s' overrides commands: %s\n")