changeset 5260:be4835ad9a85

convert: new config variable hg.tagsbranch controls which branch tags are committed to
author Brendan Cully <brendan@kublai.com>
date Mon, 27 Aug 2007 15:39:07 -0700
parents 585471802a01
children a4547dfbbf20
files hgext/convert/hg.py
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/convert/hg.py	Mon Aug 27 11:56:53 2007 -0700
+++ b/hgext/convert/hg.py	Mon Aug 27 15:39:07 2007 -0700
@@ -20,6 +20,7 @@
         self.ui = ui
         self.branchnames = ui.configbool('convert', 'hg.usebranchnames', True)
         self.clonebranches = ui.configbool('convert', 'hg.clonebranches', False)
+        self.tagsbranch = ui.config('convert', 'hg.tagsbranch', 'default')
         self.lastbranch = None
         try:
             self.repo = hg.repository(self.ui, path)
@@ -139,8 +140,15 @@
             f.close()
             if not oldlines: self.repo.add([".hgtags"])
             date = "%s 0" % int(time.mktime(time.gmtime()))
+            extra = {}
+            if self.tagsbranch != 'default':
+                extra['branch'] = self.tagsbranch
+            try:
+                tagparent = self.repo.changectx(self.tagsbranch).node()
+            except hg.RepoError, inst:
+                tagparent = nullid
             self.repo.rawcommit([".hgtags"], "update tags", "convert-repo",
-                                date, self.repo.changelog.tip(), nullid)
+                                date, tagparent, nullid)
             return hex(self.repo.changelog.tip())
 
 class mercurial_source(converter_source):