# HG changeset patch # User Antoine Perus # Date 1462805954 -7200 # Mon May 09 16:59:14 2016 +0200 # Node ID 429d410760259f846e9f1ef839b424cd3961c68b # Parent a1145cc3c62ef71b52b38b2c8175a6fb405cde38 Use @cmdutil.command decorator to define command table. diff --git a/src/b.py b/src/b.py --- a/src/b.py +++ b/src/b.py @@ -39,7 +39,10 @@ from datetime import date, datetime from operator import itemgetter from mercurial.i18n import _ -from mercurial import hg,commands +from mercurial import hg, commands, cmdutil + +cmdtable = {} +command = cmdutil.command(cmdtable) # # Version @@ -597,6 +600,20 @@ # # Command line processing # +@command("b|bug|bugs", + [ + ('f', 'force', False, _('Force this exact username')), + ('e', 'edit', False, _('Launch details editor after running command')), + ('r', 'resolved', False, _('List resolved bugs')), + ('o', 'owner', '*', _('Specify an owner to list by')), + ('g', 'grep', '', _('Filter titles by STRING')), + ('a', 'alpha', False, _('Sort list alphabetically')), + ('c', 'chrono', False, _('Sort list chronologically')), + ('T', 'truncate', False, _('Truncate list output to fit window')), + ('', 'rev', '', _('Run a read-only command against a different revision')) + ], + "cmd [args]" + ) def cmd(ui,repo,cmd = 'list',*args,**opts): """ Distributed Bug Tracker For Mercurial @@ -821,18 +838,6 @@ ui.warn(_("'%s' is not a read-only command - cannot run against a past revision\n") % e.cmd) #open=True,owner='*',grep='',verbose=False,quiet=False): -cmdtable = {"b|bug|bugs": (cmd,[ - ('f', 'force', False, _('Force this exact username')), - ('e', 'edit', False, _('Launch details editor after running command')), - ('r', 'resolved', False, _('List resolved bugs')), - ('o', 'owner', '*', _('Specify an owner to list by')), - ('g', 'grep', '', _('Filter titles by STRING')), - ('a', 'alpha', False, _('Sort list alphabetically')), - ('c', 'chrono', False, _('Sort list chronologically')), - ('T', 'truncate', False, _('Truncate list output to fit window')), - ('', 'rev', '', _('Run a read-only command against a different revision')) - ] - ,_("cmd [args]"))} # # Programmatic access to b