Mercurial > hg
comparison hgext/convert/hg.py @ 9431:d1b135f2f415
convert: fix history topology when using hg.tagsbranch
When using hg.tagsbranch, all conversions fail at
transcribing the source repo topology with conversion
scenarios interleaving:
- initial repo conversion,
- then upstream tag
- then later incremental conversion
The problem is caused by the usage of the last source
revid as source revid for the tagnode in the revision
map.
On a later incremental conversion, when resolving some
child commit of the true last source revid, convert
will parent the nodes to the tag node. If using
tagsbranch you get a bad topology where all incremental
commit nodes end up in the tag branch.
Analysis and test by Edouard Gomez <ed.gomez@free.fr>
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 06 Sep 2009 15:29:14 +0200 |
parents | 68e0a55eee6e |
children | fef209e65757 a2f36a082449 |
comparison
equal
deleted
inserted
replaced
9429:d8143769e1d4 | 9431:d1b135f2f415 |
---|---|
187 except: | 187 except: |
188 oldlines = [] | 188 oldlines = [] |
189 | 189 |
190 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) | 190 newlines = sorted([("%s %s\n" % (tags[tag], tag)) for tag in tags]) |
191 if newlines == oldlines: | 191 if newlines == oldlines: |
192 return None | 192 return None, None |
193 data = "".join(newlines) | 193 data = "".join(newlines) |
194 def getfilectx(repo, memctx, f): | 194 def getfilectx(repo, memctx, f): |
195 return context.memfilectx(f, data, False, False, None) | 195 return context.memfilectx(f, data, False, False, None) |
196 | 196 |
197 self.ui.status(_("updating tags\n")) | 197 self.ui.status(_("updating tags\n")) |
199 extra = {'branch': self.tagsbranch} | 199 extra = {'branch': self.tagsbranch} |
200 ctx = context.memctx(self.repo, (tagparent, None), "update tags", | 200 ctx = context.memctx(self.repo, (tagparent, None), "update tags", |
201 [".hgtags"], getfilectx, "convert-repo", date, | 201 [".hgtags"], getfilectx, "convert-repo", date, |
202 extra) | 202 extra) |
203 self.repo.commitctx(ctx) | 203 self.repo.commitctx(ctx) |
204 return hex(self.repo.changelog.tip()) | 204 return hex(self.repo.changelog.tip()), hex(tagparent) |
205 | 205 |
206 def setfilemapmode(self, active): | 206 def setfilemapmode(self, active): |
207 self.filemapmode = active | 207 self.filemapmode = active |
208 | 208 |
209 class mercurial_source(converter_source): | 209 class mercurial_source(converter_source): |