changeset 12658:97d7ee445e98

mq: silence spurious output. When using a versioned patch repository, you would get a spurious warning when deleting and adding the same patch. Before: $ hg qdelete --keep 3.diff $ hg qimport --existing 3.diff adding 3.diff to series file 3.diff already tracked! After: $ hg qdelete --keep 3.diff $ hg qimport --existing 3.diff adding 3.diff to series file
author Dan Villiom Podlaski Christiansen <danchr@gmail.com>
date Sat, 09 Oct 2010 11:53:48 -0500
parents 7de9033167f3
children 5aa5cbaf6efc
files hgext/mq.py tests/test-mq-qdelete.t
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/mq.py	Sat Oct 09 11:27:29 2010 -0500
+++ b/hgext/mq.py	Sat Oct 09 11:53:48 2010 -0500
@@ -479,7 +479,7 @@
         if self.added:
             qrepo = self.qrepo()
             if qrepo:
-                qrepo[None].add(self.added)
+                qrepo[None].add(f for f in self.added if f not in qrepo[None])
             self.added = []
 
     def removeundo(self, repo):
--- a/tests/test-mq-qdelete.t	Sat Oct 09 11:27:29 2010 -0500
+++ b/tests/test-mq-qdelete.t	Sat Oct 09 11:53:48 2010 -0500
@@ -150,3 +150,15 @@
   series
   status
 
+qdel -k X && hg qimp -e X used to trigger spurious output with versioned queues
+
+  $ hg init --mq
+  $ hg qimport -r 3
+  $ hg qpop
+  popping 3.diff
+  patch queue now empty
+  $ hg qdel -k 3.diff
+  $ hg qimp -e 3.diff
+  adding 3.diff to series file
+  $ hg qfinish -a
+  no patches applied