Mercurial > public > mercurial-scm > hg-stable
diff hgext/mq.py @ 12036:31f02288bbc4
mq: extend support for the --mq argument to extension commands
This allows commands like `purge' to accept the --mq option.
author | Dan Villiom Podlaski Christiansen <danchr@gmail.com> |
---|---|
date | Fri, 13 Aug 2010 16:05:08 +0200 |
parents | fca15617721c |
children | 516b000fbb7e |
line wrap: on
line diff
--- a/hgext/mq.py Sun Aug 22 13:17:34 2010 +0200 +++ b/hgext/mq.py Fri Aug 13 16:05:08 2010 +0200 @@ -2928,13 +2928,21 @@ entry = extensions.wrapcommand(commands.table, 'init', mqinit) entry[1].extend(mqopt) - norepo = commands.norepo.split(" ") - for cmd in commands.table.keys(): - cmd = cmdutil.parsealiases(cmd)[0] - if cmd in norepo: - continue - entry = extensions.wrapcommand(commands.table, cmd, mqcommand) - entry[1].extend(mqopt) + nowrap = set(commands.norepo.split(" ") + ['qrecord']) + + def dotable(cmdtable): + for cmd in cmdtable.keys(): + cmd = cmdutil.parsealiases(cmd)[0] + if cmd in nowrap: + continue + entry = extensions.wrapcommand(cmdtable, cmd, mqcommand) + entry[1].extend(mqopt) + + dotable(commands.table) + + for extname, extmodule in extensions.extensions(): + if extmodule.__file__ != __file__: + dotable(getattr(extmodule, 'cmdtable', {})) seriesopts = [('s', 'summary', None, _('print first line of patch header'))]