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