Mercurial > hgrepos > DevTools > mercurial-extensions
diff extensions/kwarchive.py @ 248:436b2db75a34
cmdutil.command is deprecated: use registrar.command instead; also need always a repository for the commands: inferrepo=True
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Thu, 03 Jan 2019 23:17:13 +0100 |
| parents | d23d3d97c106 |
| children | e97f6f6ed7c5 |
line wrap: on
line diff
--- 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
