mq: handle deleting the same patch twice in one command (issue2427)
authorDan Villiom Podlaski Christiansen <danchr@gmail.com>
Sat, 09 Oct 2010 10:36:50 -0500
changeset 12655 5192b24f309c
parent 12654 646eb9337c87
child 12656 929b424e1146
mq: handle deleting the same patch twice in one command (issue2427)
hgext/mq.py
tests/test-mq-qdelete.t
--- a/hgext/mq.py	Sat Oct 09 09:55:52 2010 -0500
+++ b/hgext/mq.py	Sat Oct 09 10:36:50 2010 -0500
@@ -765,7 +765,8 @@
                 raise util.Abort(_("cannot delete applied patch %s") % patch)
             if patch not in self.series:
                 raise util.Abort(_("patch %s not in series file") % patch)
-            realpatches.append(patch)
+            if patch not in realpatches:
+                realpatches.append(patch)
 
         numrevs = 0
         if opts.get('rev'):
--- a/tests/test-mq-qdelete.t	Sat Oct 09 09:55:52 2010 -0500
+++ b/tests/test-mq-qdelete.t	Sat Oct 09 10:36:50 2010 -0500
@@ -24,7 +24,9 @@
   popping c
   now at: b
 
-  $ hg qdel c
+Delete the same patch twice in one command (issue2427)
+
+  $ hg qdel c c
 
   $ hg qseries
   a