Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
12035:ff1044230bca | 12036:31f02288bbc4 |
---|---|
2926 extensions.wrapcommand(commands.table, 'summary', summary) | 2926 extensions.wrapcommand(commands.table, 'summary', summary) |
2927 | 2927 |
2928 entry = extensions.wrapcommand(commands.table, 'init', mqinit) | 2928 entry = extensions.wrapcommand(commands.table, 'init', mqinit) |
2929 entry[1].extend(mqopt) | 2929 entry[1].extend(mqopt) |
2930 | 2930 |
2931 norepo = commands.norepo.split(" ") | 2931 nowrap = set(commands.norepo.split(" ") + ['qrecord']) |
2932 for cmd in commands.table.keys(): | 2932 |
2933 cmd = cmdutil.parsealiases(cmd)[0] | 2933 def dotable(cmdtable): |
2934 if cmd in norepo: | 2934 for cmd in cmdtable.keys(): |
2935 continue | 2935 cmd = cmdutil.parsealiases(cmd)[0] |
2936 entry = extensions.wrapcommand(commands.table, cmd, mqcommand) | 2936 if cmd in nowrap: |
2937 entry[1].extend(mqopt) | 2937 continue |
2938 entry = extensions.wrapcommand(cmdtable, cmd, mqcommand) | |
2939 entry[1].extend(mqopt) | |
2940 | |
2941 dotable(commands.table) | |
2942 | |
2943 for extname, extmodule in extensions.extensions(): | |
2944 if extmodule.__file__ != __file__: | |
2945 dotable(getattr(extmodule, 'cmdtable', {})) | |
2938 | 2946 |
2939 seriesopts = [('s', 'summary', None, _('print first line of patch header'))] | 2947 seriesopts = [('s', 'summary', None, _('print first line of patch header'))] |
2940 | 2948 |
2941 cmdtable = { | 2949 cmdtable = { |
2942 "qapplied": | 2950 "qapplied": |