mq: simplify --mq handling / keep compatibility with other extensions
reported by edgimar on IRC
--- a/hgext/mq.py Sun Feb 28 18:02:20 2010 +0100
+++ b/hgext/mq.py Sun Feb 28 19:43:21 2010 +0100
@@ -2629,8 +2629,7 @@
return orig(ui, repo, *args, **kwargs)
def mqinit(orig, ui, *args, **kwargs):
- mq = kwargs['mq']
- del kwargs['mq']
+ mq = kwargs.pop('mq', None)
if not mq:
return orig(ui, *args, **kwargs)
@@ -2643,8 +2642,7 @@
"""Add --mq option to operate on patch repository instead of main"""
# some commands do not like getting unknown options
- mq = kwargs['mq']
- del kwargs['mq']
+ mq = kwargs.pop('mq', None)
if not mq:
return orig(ui, repo, *args, **kwargs)