Show More
@@ -389,7 +389,7 b' def rebase(ui, repo, **opts):' | |||||
389 | finally: |
|
389 | finally: | |
390 | ui.setconfig('ui', 'forcemerge', '', 'rebase') |
|
390 | ui.setconfig('ui', 'forcemerge', '', 'rebase') | |
391 | if not collapsef: |
|
391 | if not collapsef: | |
392 |
merging = |
|
392 | merging = p2 != nullrev | |
393 | editform = cmdutil.mergeeditform(merging, 'rebase') |
|
393 | editform = cmdutil.mergeeditform(merging, 'rebase') | |
394 | editor = cmdutil.getcommiteditor(editform=editform, **opts) |
|
394 | editor = cmdutil.getcommiteditor(editform=editform, **opts) | |
395 | newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn, |
|
395 | newnode = concludenode(repo, rev, p1, p2, extrafn=extrafn, | |
@@ -543,20 +543,20 b' def rebasenode(repo, rev, p1, state, col' | |||||
543 | 'Rebase a single revision' |
|
543 | 'Rebase a single revision' | |
544 | # Merge phase |
|
544 | # Merge phase | |
545 | # Update to target and merge it with local |
|
545 | # Update to target and merge it with local | |
546 |
if repo['.'].rev() != |
|
546 | if repo['.'].rev() != p1: | |
547 |
repo.ui.debug(" update to %d:%s\n" % ( |
|
547 | repo.ui.debug(" update to %d:%s\n" % (p1, repo[p1])) | |
548 | merge.update(repo, p1, False, True, False) |
|
548 | merge.update(repo, p1, False, True, False) | |
549 | else: |
|
549 | else: | |
550 | repo.ui.debug(" already in target\n") |
|
550 | repo.ui.debug(" already in target\n") | |
551 | repo.dirstate.write() |
|
551 | repo.dirstate.write() | |
552 |
repo.ui.debug(" merge against %d:%s\n" % ( |
|
552 | repo.ui.debug(" merge against %d:%s\n" % (rev, repo[rev])) | |
553 |
if |
|
553 | if rev == min(state): | |
554 | # Case (1) initial changeset of a non-detaching rebase. |
|
554 | # Case (1) initial changeset of a non-detaching rebase. | |
555 | # Let the merge mechanism find the base itself. |
|
555 | # Let the merge mechanism find the base itself. | |
556 | base = None |
|
556 | base = None | |
557 | elif not repo[rev].p2(): |
|
557 | elif not repo[rev].p2(): | |
558 | # Case (2) detaching the node with a single parent, use this parent |
|
558 | # Case (2) detaching the node with a single parent, use this parent | |
559 |
base = repo[rev].p1(). |
|
559 | base = repo[rev].p1().rev() | |
560 | else: |
|
560 | else: | |
561 | # In case of merge, we need to pick the right parent as merge base. |
|
561 | # In case of merge, we need to pick the right parent as merge base. | |
562 | # |
|
562 | # | |
@@ -583,8 +583,8 b' def rebasenode(repo, rev, p1, state, col' | |||||
583 | # Which does not represent anything sensible and creates a lot of |
|
583 | # Which does not represent anything sensible and creates a lot of | |
584 | # conflicts. |
|
584 | # conflicts. | |
585 | for p in repo[rev].parents(): |
|
585 | for p in repo[rev].parents(): | |
586 |
if state.get(p.rev()) == |
|
586 | if state.get(p.rev()) == p1: | |
587 |
base = p. |
|
587 | base = p.rev() | |
588 | break |
|
588 | break | |
589 | else: # fallback when base not found |
|
589 | else: # fallback when base not found | |
590 | base = None |
|
590 | base = None | |
@@ -593,7 +593,7 b' def rebasenode(repo, rev, p1, state, col' | |||||
593 | raise AssertionError('no base found to rebase on ' |
|
593 | raise AssertionError('no base found to rebase on ' | |
594 | '(rebasenode called wrong)') |
|
594 | '(rebasenode called wrong)') | |
595 | if base is not None: |
|
595 | if base is not None: | |
596 |
repo.ui.debug(" detach base %d:%s\n" % ( |
|
596 | repo.ui.debug(" detach base %d:%s\n" % (base, repo[base])) | |
597 | # When collapsing in-place, the parent is the common ancestor, we |
|
597 | # When collapsing in-place, the parent is the common ancestor, we | |
598 | # have to allow merging with it. |
|
598 | # have to allow merging with it. | |
599 | stats = merge.update(repo, rev, True, True, False, base, collapse, |
|
599 | stats = merge.update(repo, rev, True, True, False, base, collapse, | |
@@ -835,7 +835,7 b' def abort(repo, originalwd, target, stat' | |||||
835 | if cleanup: |
|
835 | if cleanup: | |
836 | # Update away from the rebase if necessary |
|
836 | # Update away from the rebase if necessary | |
837 | if inrebase(repo, originalwd, state): |
|
837 | if inrebase(repo, originalwd, state): | |
838 |
merge.update(repo, |
|
838 | merge.update(repo, originalwd, False, True, False) | |
839 |
|
839 | |||
840 | # Strip from the first rebased revision |
|
840 | # Strip from the first rebased revision | |
841 | rebased = filter(lambda x: x > -1 and x != target, state.values()) |
|
841 | rebased = filter(lambda x: x > -1 and x != target, state.values()) |
General Comments 0
You need to be logged in to leave comments.
Login now