# HG changeset patch # User Matt Mackall # Date 1128565545 25200 # Node ID 0c7e8d3455641767fb8cc991d8c70a9bcd110aa7 # Parent a1040345fdda7f5ee0cb6ba519e50a7ebabe3615 convert-repo: linearize the tag commit diff -r a1040345fdda -r 0c7e8d345564 contrib/convert-repo --- a/contrib/convert-repo Wed Oct 05 17:11:06 2005 -0700 +++ b/contrib/convert-repo Wed Oct 05 19:25:45 2005 -0700 @@ -160,6 +160,7 @@ date = "%s 0" % int(time.mktime(time.gmtime())) self.repo.rawcommit([".hgtags"], "update tags", "convert-repo", date, self.repo.changelog.tip(), hg.nullid) + return hg.hex(self.repo.changelog.tip()) class convert: def __init__(self, source, dest, mapfile): @@ -269,7 +270,11 @@ if v in self.map: ctags[k] = self.map[v] - self.dest.puttags(ctags) + if ctags: + nrev = self.dest.puttags(ctags) + # write another hash correspondence to override the previous + # one so we don't end up with extra tag heads + file(self.mapfile, "a").write("%s %s\n" % (c, nrev)) gitpath, hgpath, mapfile = sys.argv[1:] if os.path.isdir(gitpath + "/.git"):