[PATCH 05 of 10] Do not ignore already-seen tags

jgoerzen at complete.org jgoerzen at complete.org
Sun Mar 4 13:16:13 CST 2007


# HG changeset patch
# User John Goerzen <jgoerzen at complete.org>
# Date 1173020977 21600
# Node ID 518329db947de811133e2337f6211888820410ab
# Parent  5ac608d100e32077aa16bc75f483820c900d4d2f
Do not ignore already-seen tags
It is perfectly valid in both Darcs and Mercurial to apply the same tag more
than once.  While one may question the sanity of that, the most accurate
conversion of the Darcs repo into Mercurial will preserve any number of
Darcs tags with the same name.

Moreover, this too helps preserve revision numbers for TracDarcs.

diff --git a/contrib/darcs2hg.py b/contrib/darcs2hg.py
--- a/contrib/darcs2hg.py
+++ b/contrib/darcs2hg.py
@@ -132,14 +132,8 @@ def hg_tag( hg_repo, text, author, date 
 def hg_tag( hg_repo, text, author, date ):
 	old_tip = hg_tip(hg_repo)
 	text = text.strip()
-	tag_file = hg_repo + "/.hgtags"
-	res = cmd("hg tags", hg_repo, silent=True)
-	(dead_text,hit) = re.subn(text,'',res)
-	if hit == 0:
-		cmd("hg tag -u \"%s\" -d \"%s 0\" \"%s\""  % (author, date, text), hg_repo)
-		new_tip = hg_tip(hg_repo)
-	else:
-		print "Ignoring already seen tag %s\n" % (text)
+        cmd("hg tag -u \"%s\" -d \"%s 0\" \"%s\""  % (author, date, text), hg_repo)
+        new_tip = hg_tip(hg_repo)
 
 # ------------------------------------------------------------------------------
 #



More information about the Mercurial-devel mailing list