Show More
@@ -611,40 +611,40 b' def defineparents(repo, rev, target, sta' | |||||
611 | parents = repo[rev].parents() |
|
611 | parents = repo[rev].parents() | |
612 | p1 = p2 = nullrev |
|
612 | p1 = p2 = nullrev | |
613 |
|
613 | |||
614 |
|
|
614 | p1n = parents[0].rev() | |
615 |
if |
|
615 | if p1n in targetancestors: | |
616 | p1 = target |
|
616 | p1 = target | |
617 |
elif |
|
617 | elif p1n in state: | |
618 |
if state[ |
|
618 | if state[p1n] == nullmerge: | |
619 | p1 = target |
|
619 | p1 = target | |
620 |
elif state[ |
|
620 | elif state[p1n] == revignored: | |
621 |
p1 = nearestrebased(repo, |
|
621 | p1 = nearestrebased(repo, p1n, state) | |
622 | if p1 is None: |
|
622 | if p1 is None: | |
623 | p1 = target |
|
623 | p1 = target | |
624 | else: |
|
624 | else: | |
625 |
p1 = state[ |
|
625 | p1 = state[p1n] | |
626 |
else: # |
|
626 | else: # p1n external | |
627 | p1 = target |
|
627 | p1 = target | |
628 |
p2 = |
|
628 | p2 = p1n | |
629 |
|
629 | |||
630 | if len(parents) == 2 and parents[1].rev() not in targetancestors: |
|
630 | if len(parents) == 2 and parents[1].rev() not in targetancestors: | |
631 |
|
|
631 | p2n = parents[1].rev() | |
632 | # interesting second parent |
|
632 | # interesting second parent | |
633 |
if |
|
633 | if p2n in state: | |
634 |
if p1 == target: # |
|
634 | if p1 == target: # p1n in targetancestors or external | |
635 |
p1 = state[ |
|
635 | p1 = state[p2n] | |
636 |
elif state[ |
|
636 | elif state[p2n] == revignored: | |
637 |
p2 = nearestrebased(repo, |
|
637 | p2 = nearestrebased(repo, p2n, state) | |
638 | if p2 is None: |
|
638 | if p2 is None: | |
639 | # no ancestors rebased yet, detach |
|
639 | # no ancestors rebased yet, detach | |
640 | p2 = target |
|
640 | p2 = target | |
641 | else: |
|
641 | else: | |
642 |
p2 = state[ |
|
642 | p2 = state[p2n] | |
643 |
else: # |
|
643 | else: # p2n external | |
644 |
if p2 != nullrev: # |
|
644 | if p2 != nullrev: # p1n external too => rev is a merged revision | |
645 | raise util.Abort(_('cannot use revision %d as base, result ' |
|
645 | raise util.Abort(_('cannot use revision %d as base, result ' | |
646 | 'would have 3 parents') % rev) |
|
646 | 'would have 3 parents') % rev) | |
647 |
p2 = |
|
647 | p2 = p2n | |
648 | repo.ui.debug(" future parents are %d and %d\n" % |
|
648 | repo.ui.debug(" future parents are %d and %d\n" % | |
649 | (repo[p1].rev(), repo[p2].rev())) |
|
649 | (repo[p1].rev(), repo[p2].rev())) | |
650 | return p1, p2 |
|
650 | return p1, p2 |
General Comments 0
You need to be logged in to leave comments.
Login now