From patchwork Fri Dec 8 07:27:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise From: phabricator X-Patchwork-Id: 26082 Message-Id: <64f45075f1aae3cb87f4a91e1b8892d9@localhost.localdomain> To: mercurial-devel@mercurial-scm.org Date: Fri, 8 Dec 2017 07:27:29 +0000 phillco updated this revision to Diff 4246. REPOSITORY rHG Mercurial CHANGES SINCE LAST UPDATE https://phab.mercurial-scm.org/D1249?vs=4240&id=4246 REVISION DETAIL https://phab.mercurial-scm.org/D1249 AFFECTED FILES hgext/rebase.py CHANGE DETAILS To: phillco, #hg-reviewers, durin42 Cc: mercurial-devel diff --git a/hgext/rebase.py b/hgext/rebase.py --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -646,6 +646,25 @@ cmdutil.formatteropts, _('[-s REV | -b REV] [-d REV] [OPTION]')) def rebase(ui, repo, **opts): + if opts.get('continue') or opts.get('abort'): + # in-memory rebase is not compatible with resuming rebases. + opts['inmemory'] = False + + if opts.get('inmemory', False): + try: + # in-memory merge doesn't support conflicts, so if we hit any, abort + # and re-run as an on-disk merge. + return _origrebase(ui, repo, **opts) + except error.InMemoryMergeConflictsError: + ui.warn(_('hit merge conflicts; re-running rebase without in-memory' + ' merge\n')) + _origrebase(ui, repo, **{'abort': True}) + opts['inmemory'] = False + return _origrebase(ui, repo, **opts) + else: + return _origrebase(ui, repo, **opts) + +def _origrebase(ui, repo, **opts): """move changeset (and descendants) to a different branch Rebase uses repeated merging to graft changesets from one part of