# HG changeset patch # User Brendan Cully # Date 1188254347 25200 # Node ID be4835ad9a85a3babe444bc5c192bae6b605b013 # Parent 585471802a01829cc34c5d05f96144c9dbc943b7 convert: new config variable hg.tagsbranch controls which branch tags are committed to diff --git a/hgext/convert/hg.py b/hgext/convert/hg.py --- a/hgext/convert/hg.py +++ b/hgext/convert/hg.py @@ -20,6 +20,7 @@ class mercurial_sink(converter_sink): 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 @@ class mercurial_sink(converter_sink): 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):