mq: simplify --mq handling / keep compatibility with other extensions stable
authorBenoit Boissinot <benoit.boissinot@ens-lyon.org>
Sun, 28 Feb 2010 19:43:21 +0100
branchstable
changeset 10558 6505773080e4
parent 10556 9bd0bd785696
child 10559 b1339234080e
mq: simplify --mq handling / keep compatibility with other extensions reported by edgimar on IRC
hgext/mq.py
--- 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)