[PATCH 1 of 2] Add a test highlighting duplicate tags issues

Pierre-Yves David pierre-yves.david at ens-lyon.org
Thu Apr 8 04:38:21 CDT 2010


# HG changeset patch
# User Pierre-Yves David <pierre-yves.david at ens-lyon.org>
# Date 1270719041 -7200
# Branch stable
# Node ID 892f5ed1ca1ed2e89144f7537103bda768a50ea3
# Parent  1148a968a0700d047c790edd5cbded240534da2e
Add a test highlighting duplicate tags issues

This changetset add test-tag-duplicates that highlight the following issue:

When a tag is overwritten using the --force option, two line are added to the
.hgtags file intead of one. One with the old changeset hash previously tagged
and one with the new changeset tagged by the command. The old changeset hash
then appear twice before beeing finally overwriten by the new changeset tagged.

diff --git a/tests/test-tag-duplicates b/tests/test-tag-duplicates
new file mode 100755
--- /dev/null
+++ b/tests/test-tag-duplicates
@@ -0,0 +1,15 @@
+#!/bin/sh
+mkdir doubletags
+cd doubletags
+hg init
+echo 'toto' > bob
+hg add bob
+hg ci -m 0
+hg tag my_tag
+echo 'first tagging'
+cat .hgtags
+echo 'tata' >> bob 
+hg ci -m 1
+hg tag -f my_tag
+echo 'second tagging'
+cat .hgtags
diff --git a/tests/test-tag-duplicates.out b/tests/test-tag-duplicates.out
new file mode 100644
--- /dev/null
+++ b/tests/test-tag-duplicates.out
@@ -0,0 +1,5 @@
+first tagging
+090157ca0c2f6ece695e249c097c7e71541c1537 my_tag
+second tagging
+090157ca0c2f6ece695e249c097c7e71541c1537 my_tag
+a4abcafa9fedb3602793f3c46f2bdb943e943502 my_tag


More information about the Mercurial-devel mailing list