Show More
@@ -55,11 +55,13 b" SKIPREV = 'SKIP'" | |||
|
55 | 55 | |
|
56 | 56 | class commit(object): |
|
57 | 57 | def __init__(self, author, date, desc, parents, branch=None, rev=None, |
|
58 |
extra={}, sortkey=None, saverev=True, phase=phases.draft |
|
|
58 | extra={}, sortkey=None, saverev=True, phase=phases.draft, | |
|
59 | optparents=None): | |
|
59 | 60 | self.author = author or 'unknown' |
|
60 | 61 | self.date = date or '0 0' |
|
61 | 62 | self.desc = desc |
|
62 | self.parents = parents | |
|
63 | self.parents = parents # will be converted and used as parents | |
|
64 | self.optparents = optparents or [] # will be used if already converted | |
|
63 | 65 | self.branch = branch |
|
64 | 66 | self.rev = rev |
|
65 | 67 | self.extra = extra |
@@ -472,6 +472,9 b' class converter(object):' | |||
|
472 | 472 | parents = [self.map.get(p, p) for p in parents] |
|
473 | 473 | except KeyError: |
|
474 | 474 | parents = [b[0] for b in pbranches] |
|
475 | parents.extend(self.map[x] | |
|
476 | for x in commit.optparents | |
|
477 | if x in self.map) | |
|
475 | 478 | if len(pbranches) != 2: |
|
476 | 479 | cleanp2 = set() |
|
477 | 480 | if len(parents) < 3: |
@@ -582,7 +582,9 b' class mercurial_source(common.converter_' | |||
|
582 | 582 | |
|
583 | 583 | def getcommit(self, rev): |
|
584 | 584 | ctx = self._changectx(rev) |
|
585 |
parents = |
|
|
585 | _parents = self._parents(ctx) | |
|
586 | parents = [p.hex() for p in _parents] | |
|
587 | optparents = [p.hex() for p in ctx.parents() if p and p not in _parents] | |
|
586 | 588 | crev = rev |
|
587 | 589 | |
|
588 | 590 | return common.commit(author=ctx.user(), |
@@ -591,6 +593,7 b' class mercurial_source(common.converter_' | |||
|
591 | 593 | desc=ctx.description(), |
|
592 | 594 | rev=crev, |
|
593 | 595 | parents=parents, |
|
596 | optparents=optparents, | |
|
594 | 597 | branch=ctx.branch(), |
|
595 | 598 | extra=ctx.extra(), |
|
596 | 599 | sortkey=ctx.rev(), |
@@ -222,7 +222,7 b' Convert from specified revs' | |||
|
222 | 222 | o 0 "0: add a b f" files: a b f |
|
223 | 223 | |
|
224 | 224 | Convert in multiple steps that doesn't overlap - the link to the parent is |
|
225 | currently missing | |
|
225 | preserved anyway | |
|
226 | 226 | |
|
227 | 227 | $ hg convert --config convert.hg.revs=::1 source multistep |
|
228 | 228 | initializing destination multistep repository |
@@ -237,8 +237,8 b' currently missing' | |||
|
237 | 237 | converting... |
|
238 | 238 | 0 2: copy e from a, change b |
|
239 | 239 | $ glog multistep |
|
240 |
o 2 "2: copy e from a, change b" files: |
|
|
241 | ||
|
240 | o 2 "2: copy e from a, change b" files: b e | |
|
241 | | | |
|
242 | 242 | o 1 "1: add c, move f to d" files: c d f |
|
243 | 243 | | |
|
244 | 244 | o 0 "0: add a b f" files: a b f |
General Comments 0
You need to be logged in to leave comments.
Login now