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
--- 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