mirror of
https://github.com/facebook/sapling.git
synced 2024-10-09 00:14:35 +03:00
convert: new config variable hg.tagsbranch controls which branch tags are committed to
This commit is contained in:
parent
d9a2ba66f8
commit
4d5be2d7bc
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user