Show More
@@ -20,6 +20,7 class mercurial_sink(converter_sink): | |||||
20 | self.ui = ui |
|
20 | self.ui = ui | |
21 | self.branchnames = ui.configbool('convert', 'hg.usebranchnames', True) |
|
21 | self.branchnames = ui.configbool('convert', 'hg.usebranchnames', True) | |
22 | self.clonebranches = ui.configbool('convert', 'hg.clonebranches', False) |
|
22 | self.clonebranches = ui.configbool('convert', 'hg.clonebranches', False) | |
|
23 | self.tagsbranch = ui.config('convert', 'hg.tagsbranch', 'default') | |||
23 | self.lastbranch = None |
|
24 | self.lastbranch = None | |
24 | try: |
|
25 | try: | |
25 | self.repo = hg.repository(self.ui, path) |
|
26 | self.repo = hg.repository(self.ui, path) | |
@@ -139,8 +140,15 class mercurial_sink(converter_sink): | |||||
139 | f.close() |
|
140 | f.close() | |
140 | if not oldlines: self.repo.add([".hgtags"]) |
|
141 | if not oldlines: self.repo.add([".hgtags"]) | |
141 | date = "%s 0" % int(time.mktime(time.gmtime())) |
|
142 | date = "%s 0" % int(time.mktime(time.gmtime())) | |
|
143 | extra = {} | |||
|
144 | if self.tagsbranch != 'default': | |||
|
145 | extra['branch'] = self.tagsbranch | |||
|
146 | try: | |||
|
147 | tagparent = self.repo.changectx(self.tagsbranch).node() | |||
|
148 | except hg.RepoError, inst: | |||
|
149 | tagparent = nullid | |||
142 | self.repo.rawcommit([".hgtags"], "update tags", "convert-repo", |
|
150 | self.repo.rawcommit([".hgtags"], "update tags", "convert-repo", | |
143 |
date, |
|
151 | date, tagparent, nullid) | |
144 | return hex(self.repo.changelog.tip()) |
|
152 | return hex(self.repo.changelog.tip()) | |
145 |
|
153 | |||
146 | class mercurial_source(converter_source): |
|
154 | class mercurial_source(converter_source): |
General Comments 0
You need to be logged in to leave comments.
Login now