Patchwork D1249: rebase: rerun a rebase on-disk if IMM merge conflicts arise

login
register
mail settings
Submitter phabricator
Date Dec. 8, 2017, 8:28 p.m.
Message ID <a85018299c1f5dd4c1339787611c7c5e@localhost.localdomain>
Download mbox | patch
Permalink /patch/26118/
State Not Applicable
Headers show

Comments

phabricator - Dec. 8, 2017, 8:28 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGd901a88891fe: rebase: rerun a rebase on-disk if IMM merge conflicts arise (authored by phillco, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1249?vs=4261&id=4266

REVISION DETAIL
  https://phab.mercurial-scm.org/D1249

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: phillco, #hg-reviewers, durin42, dlax
Cc: dlax, mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -759,6 +759,25 @@ 
     unresolved conflicts.
 
     """
+    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):
     opts = pycompat.byteskwargs(opts)
     if 'inmemory' not in opts:
         opts['inmemory'] = False