# HG changeset patch # User Franz Glasner # Date 1546553833 -3600 # Node ID 436b2db75a34506c02ff797ee8ad733a4032f3ee # Parent d23d3d97c1064dfb23974dc7fa29005557fff029 cmdutil.command is deprecated: use registrar.command instead; also need always a repository for the commands: inferrepo=True diff -r d23d3d97c106 -r 436b2db75a34 extensions/kwarchive.py --- a/extensions/kwarchive.py Thu Dec 20 00:01:59 2018 +0100 +++ b/extensions/kwarchive.py Thu Jan 03 23:17:13 2019 +0100 @@ -89,6 +89,10 @@ from mercurial.i18n import _ from mercurial import (archival, config, cmdutil, error, match, pycompat, scmutil, templatefilters, util, node) +try: + from mercurial import registrar +except ImportError: + registrar = None testedwith = "4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1" @@ -107,7 +111,10 @@ cmdtable = {} -command = cmdutil.command(cmdtable) +if registrar: + command = registrar.command(cmdtable) +else: + command = cmdutil.command(cmdtable) def getversion(): @@ -147,7 +154,8 @@ ('', "path-filter", "short", _("determine how the path will be printed")), ('', "user-filter", "user", _("the part of the user to be printed"), _("USERFILTER")) ] + cmdutil.subrepoopts + cmdutil.walkopts, - _('[OPTION]... DEST')) + _('[OPTION]... DEST'), + inferrepo=True) def kwarchive(ui, repo, dest, **opts): '''create an unversioned archive of a repository revision with some keywords expanded @@ -276,7 +284,8 @@ ('', "reST", None, _("output in reST substitution definition syntax")), ('', "no-file", None, _("don't show file-dependent keywords")), ] + cmdutil.subrepoopts + cmdutil.walkopts, - _('[OPTION]...')) + _('[OPTION]...'), + inferrepo=True) def kwprint(ui, repo, **opts): '''print the file-independent keywords and for an example file-dependent keywords diff -r d23d3d97c106 -r 436b2db75a34 extensions/revinfo.py --- a/extensions/revinfo.py Thu Dec 20 00:01:59 2018 +0100 +++ b/extensions/revinfo.py Thu Jan 03 23:17:13 2019 +0100 @@ -15,11 +15,19 @@ from mercurial.i18n import _ from mercurial import cmdutil, scmutil, util, error, archival, pycompat +try: + from mercurial import registrar +except ImportError: + registrar = None cmdtable = {} -command = cmdutil.command(cmdtable) +if registrar: + command = registrar.command(cmdtable) +else: + command = cmdutil.command(cmdtable) + testedwith = "3.5 3.5.1 3.5.2 4.3.1 4.3.2 4.4.1 4.4.2 4.5.2 4.6.1" @@ -55,7 +63,8 @@ ("p", "path", [], _('the configured default path'), _('SOURCE')), ("d", "data", [], _("add an extra `KEY: VALUE' pair into the file"), _('KEY=VALUE')), ], - _("hg revinfo [OPTION]... [DEST]")) + _("hg revinfo [OPTION]... [DEST]"), + inferrepo=True) def revinfo(ui, repo, dest=None, **opts): """write a revision summary