# HG changeset patch # User Brendan Cully # Date 1265621024 -3600 # Node ID 6252852b4332f8bde5caabdb87057875f2b6de75 # Parent fb203201ce308017600a78750ca897e73aa2458f mq: add -Q option to all commands not in norepo diff -r fb203201ce30 -r 6252852b4332 hgext/mq.py --- a/hgext/mq.py Sun Feb 07 23:07:58 2010 +0100 +++ b/hgext/mq.py Mon Feb 08 10:23:44 2010 +0100 @@ -2638,8 +2638,10 @@ def uisetup(ui): extensions.wrapcommand(commands.table, 'import', mqimport) - for cmd in ('commit', 'export', 'incoming', 'log', 'outgoing', 'pull', - 'push', 'status', 'tag', 'tags', 'tip', 'update'): + for cmd in commands.table: + cmd = cmdutil.parsealiases(cmd)[0] + if cmd in commands.norepo: + continue entry = extensions.wrapcommand(commands.table, cmd, mqcommand) entry[1].extend([('Q', 'mq', None, _("operate on patch repository"))]) diff -r fb203201ce30 -r 6252852b4332 mercurial/cmdutil.py --- a/mercurial/cmdutil.py Sun Feb 07 23:07:58 2010 +0100 +++ b/mercurial/cmdutil.py Mon Feb 08 10:23:44 2010 +0100 @@ -13,6 +13,9 @@ revrangesep = ':' +def parsealiases(cmd): + return cmd.lstrip("^").split("|") + def findpossible(cmd, table, strict=False): """ Return cmd -> (aliases, command table entry) @@ -22,7 +25,7 @@ choice = {} debugchoice = {} for e in table.keys(): - aliases = e.lstrip("^").split("|") + aliases = parsealiases(e) found = None if cmd in aliases: found = cmd