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

Edouard Gomez ed.gomez at free.fr
Sun Dec 17 15:31:54 UTC 2006


# HG changeset patch
# User Edouard Gomez <ed.gomez at free.fr>
# Date 1166365518 -3600
# Node ID e617e4f331a1fdbf8bb349f6e80fbd4c8d5ac154
# Parent  6c3c7fd48f4d7a56dadbc89384b97ac16558214e
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 6c3c7fd48f4d -r e617e4f331a1 hg-cvs-import
--- a/hg-cvs-import	Sun Dec 17 15:18:38 2006 +0100
+++ b/hg-cvs-import	Sun Dec 17 15:25:18 2006 +0100
@@ -175,9 +175,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