[PATCH] mq: handle deleting the same patch twice in once command (issue2427)

Dan Villiom Podlaski Christiansen danchr at gmail.com
Sat Oct 9 10:36:56 CDT 2010


# HG changeset patch
# User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
# Date 1286638610 18000
# Node ID 1cea6f800d2df4618aa5aaa6ebb8dce13671b2ce
# Parent  cf135a1c2bd2410bd6eae18cdb59499a51088a3c
mq: handle deleting the same patch twice in once command (issue2427)

diff --git a/hgext/mq.py b/hgext/mq.py
--- a/hgext/mq.py
+++ b/hgext/mq.py
@@ -765,7 +765,8 @@ class queue(object):
                 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'):
diff --git a/tests/test-mq-qdelete.t b/tests/test-mq-qdelete.t
--- a/tests/test-mq-qdelete.t
+++ b/tests/test-mq-qdelete.t
@@ -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


More information about the Mercurial-devel mailing list