Mercurial > hg
comparison hgext/rebase.py @ 45549:e9468f14379a
rebase: move check for unresolved conflicts into lower-level rebasenode()
I want to add another call to `rebasenode()` and it's better to not
have to duplicate the check.
Differential Revision: https://phab.mercurial-scm.org/D9075
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 23 Sep 2020 09:04:32 -0700 |
parents | 25e365d5aa8f |
children | feffeb18d412 |
comparison
equal
deleted
inserted
replaced
45548:25e365d5aa8f | 45549:e9468f14379a |
---|---|
613 repo.ui.debug(b'resuming interrupted rebase\n') | 613 repo.ui.debug(b'resuming interrupted rebase\n') |
614 self.resume = False | 614 self.resume = False |
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 stats = rebasenode( | 618 rebasenode( |
619 repo, rev, p1, p2, base, self.collapsef, wctx=self.wctx, | 619 repo, rev, p1, p2, base, self.collapsef, wctx=self.wctx, |
620 ) | 620 ) |
621 if stats.unresolvedcount > 0: | |
622 if self.inmemory: | |
623 raise error.InMemoryMergeConflictsError() | |
624 else: | |
625 raise error.ConflictResolutionRequired(b'rebase') | |
626 if not self.collapsef: | 621 if not self.collapsef: |
627 merging = p2 != nullrev | 622 merging = p2 != nullrev |
628 editform = cmdutil.mergeeditform(merging, b'rebase') | 623 editform = cmdutil.mergeeditform(merging, b'rebase') |
629 editor = cmdutil.getcommiteditor( | 624 editor = cmdutil.getcommiteditor( |
630 editform=editform, **pycompat.strkwargs(opts) | 625 editform=editform, **pycompat.strkwargs(opts) |
1498 else: | 1493 else: |
1499 # If we're not using --collapse, we need to | 1494 # If we're not using --collapse, we need to |
1500 # duplicate copies between the revision we're | 1495 # duplicate copies between the revision we're |
1501 # rebasing and its first parent. | 1496 # rebasing and its first parent. |
1502 copies.graftcopies(wctx, ctx, ctx.p1()) | 1497 copies.graftcopies(wctx, ctx, ctx.p1()) |
1503 return stats | 1498 |
1499 if stats.unresolvedcount > 0: | |
1500 if wctx.isinmemory(): | |
1501 raise error.InMemoryMergeConflictsError() | |
1502 else: | |
1503 raise error.ConflictResolutionRequired(b'rebase') | |
1504 | 1504 |
1505 | 1505 |
1506 def adjustdest(repo, rev, destmap, state, skipped): | 1506 def adjustdest(repo, rev, destmap, state, skipped): |
1507 r"""adjust rebase destination given the current rebase state | 1507 r"""adjust rebase destination given the current rebase state |
1508 | 1508 |