##// END OF EJS Templates
rebase: teach in-memory rebase to not restart with on-disk rebase on conflict...
Martin von Zweigbergk -
r46517:feffeb18 default
parent child Browse files
Show More
@@ -615,9 +615,49 b' class rebaseruntime(object):'
615 else:
615 else:
616 overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')}
616 overrides = {(b'ui', b'forcemerge'): opts.get(b'tool', b'')}
617 with ui.configoverride(overrides, b'rebase'):
617 with ui.configoverride(overrides, b'rebase'):
618 rebasenode(
618 try:
619 repo, rev, p1, p2, base, self.collapsef, wctx=self.wctx,
619 rebasenode(
620 )
620 repo,
621 rev,
622 p1,
623 p2,
624 base,
625 self.collapsef,
626 wctx=self.wctx,
627 )
628 except error.InMemoryMergeConflictsError:
629 if self.dryrun:
630 raise error.ConflictResolutionRequired(b'rebase')
631 if self.collapsef:
632 # TODO: Make the overlayworkingctx reflected
633 # in the working copy here instead of re-raising
634 # so the entire rebase operation is retried.
635 raise
636 ui.status(
637 _(
638 b"hit merge conflicts; rebasing that "
639 b"commit again in the working copy\n"
640 )
641 )
642 cmdutil.bailifchanged(repo)
643 self.inmemory = False
644 self._assignworkingcopy()
645 mergemod.update(
646 repo,
647 p1,
648 branchmerge=False,
649 force=False,
650 wc=self.wctx,
651 )
652 rebasenode(
653 repo,
654 rev,
655 p1,
656 p2,
657 base,
658 self.collapsef,
659 wctx=self.wctx,
660 )
621 if not self.collapsef:
661 if not self.collapsef:
622 merging = p2 != nullrev
662 merging = p2 != nullrev
623 editform = cmdutil.mergeeditform(merging, b'rebase')
663 editform = cmdutil.mergeeditform(merging, b'rebase')
@@ -1100,7 +1140,7 b' def _dryrunrebase(ui, repo, action, opts'
1100 _origrebase(
1140 _origrebase(
1101 ui, repo, action, opts, rbsrt,
1141 ui, repo, action, opts, rbsrt,
1102 )
1142 )
1103 except error.InMemoryMergeConflictsError:
1143 except error.ConflictResolutionRequired:
1104 ui.status(_(b'hit a merge conflict\n'))
1144 ui.status(_(b'hit a merge conflict\n'))
1105 return 1
1145 return 1
1106 except error.Abort:
1146 except error.Abort:
@@ -415,8 +415,6 b' Make a conflict:'
415 rebasing 3:055a42cdd887 "d"
415 rebasing 3:055a42cdd887 "d"
416 rebasing 4:e860deea161a "e"
416 rebasing 4:e860deea161a "e"
417 merging e
417 merging e
418 transaction abort!
419 rollback completed
420 hit a merge conflict
418 hit a merge conflict
421 [1]
419 [1]
422 $ hg diff
420 $ hg diff
@@ -463,12 +461,7 b' In-memory rebase that fails due to merge'
463 rebasing 3:055a42cdd887 "d"
461 rebasing 3:055a42cdd887 "d"
464 rebasing 4:e860deea161a "e"
462 rebasing 4:e860deea161a "e"
465 merging e
463 merging e
466 transaction abort!
464 hit merge conflicts; rebasing that commit again in the working copy
467 rollback completed
468 hit merge conflicts; re-running rebase without in-memory merge
469 rebasing 2:177f92b77385 "c"
470 rebasing 3:055a42cdd887 "d"
471 rebasing 4:e860deea161a "e"
472 merging e
465 merging e
473 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
466 warning: conflicts while merging e! (edit, then use 'hg resolve --mark')
474 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
467 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
@@ -487,9 +480,9 b" Retrying without in-memory merge won't l"
487 rebasing 3:055a42cdd887 "d"
480 rebasing 3:055a42cdd887 "d"
488 rebasing 4:e860deea161a "e"
481 rebasing 4:e860deea161a "e"
489 merging e
482 merging e
483 hit merge conflicts; rebasing that commit again in the working copy
490 transaction abort!
484 transaction abort!
491 rollback completed
485 rollback completed
492 hit merge conflicts; re-running rebase without in-memory merge
493 abort: uncommitted changes
486 abort: uncommitted changes
494 [255]
487 [255]
495 $ cat a
488 $ cat a
@@ -859,8 +852,7 b' Test rebasing when the file we are mergi'
859 $ hg rebase -r . -d 1 --config ui.merge=internal:merge3
852 $ hg rebase -r . -d 1 --config ui.merge=internal:merge3
860 rebasing 2:fb62b706688e "add b to foo" (tip)
853 rebasing 2:fb62b706688e "add b to foo" (tip)
861 merging foo
854 merging foo
862 hit merge conflicts; re-running rebase without in-memory merge
855 hit merge conflicts; rebasing that commit again in the working copy
863 rebasing 2:fb62b706688e "add b to foo" (tip)
864 merging foo
856 merging foo
865 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
857 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
866 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
858 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
@@ -893,8 +885,7 b" Test rebasing when we're in the middle o"
893 $ hg rebase -r 2 -d 1 -t:merge3
885 $ hg rebase -r 2 -d 1 -t:merge3
894 rebasing 2:b4d249fbf8dd "bye from foo"
886 rebasing 2:b4d249fbf8dd "bye from foo"
895 merging foo
887 merging foo
896 hit merge conflicts; re-running rebase without in-memory merge
888 hit merge conflicts; rebasing that commit again in the working copy
897 rebasing 2:b4d249fbf8dd "bye from foo"
898 merging foo
889 merging foo
899 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
890 warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
900 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
891 unresolved conflicts (see 'hg resolve', then 'hg rebase --continue')
General Comments 0
You need to be logged in to leave comments. Login now