[PATCH 08 of 12] Add tags to node(0) and save this as special patchset 0

Edouard Gomez ed.gomez at free.fr
Tue Dec 19 06:05:49 UTC 2006


# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1166511815 -3600
# Node ID 20f490e5eae2422977172ff75e123c083cb29ac8
# Parent  22e9a03043477a6c2c3283c2dbc36abf6b8896d5
Add tags to node(0) and save this as special patchset 0

Commiting new tags using HEAD is bad because it gets into the CVS repo original
history. So commit the hgtag using the patchset 0 hg node (0 is not used by
cvsps) and as fallback for the first tag update, the rev 0 node

diff -r 22e9a0304347 -r 20f490e5eae2 hg-cvs-import
--- a/hg-cvs-import	Tue Dec 19 08:03:35 2006 +0100
+++ b/hg-cvs-import	Tue Dec 19 08:03:35 2006 +0100
@@ -176,9 +176,10 @@ def committags(patchset):
 
         date = "%s 0" % int(time.mktime(time.gmtime()))
         user = namemap.get('convert-repo', 'convert-repo')
+        node = map.get(0, hg.hex(repo.changelog.node(0)))
         n = repo.rawcommit([".hgtags"], "Update tags", user,
-                        date, repo.changelog.tip(), hg.nullid)
-        mapf.write("%d %s\n" % (patchset, hg.hex(repo.changelog.tip())))
+                        date, hg.bin(node), hg.nullid)
+        mapf.write("%d %s\n" % (0, hg.hex(repo.changelog.tip())))
 
 def branchlookup(branch):
     # XXX: Flush the repo branch cache



More information about the Mercurial-devel mailing list