Patchwork D8623: rebase: add environment variable to allow forcing in-memory rebase

login
register
mail settings
Submitter phabricator
Date June 9, 2020, 8:53 p.m.
Message ID <differential-rev-PHID-DREV-ypnouqz3c6ztroy2pamw-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46491/
State New
Headers show

Comments

phabricator - June 9, 2020, 8:53 p.m.
durin42 created this revision.
Herald added a reviewer: martinvonz.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  Use it in a test case where we know the rebase should proceed without
  incident in-memory, so we can see tracebacks rather than fallbacks.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-copies-in-changeset.t

CHANGE DETAILS




To: durin42, martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/tests/test-copies-in-changeset.t b/tests/test-copies-in-changeset.t
--- a/tests/test-copies-in-changeset.t
+++ b/tests/test-copies-in-changeset.t
@@ -356,7 +356,7 @@ 
   $ hg co -q 0
   $ hg mv a b
   $ hg ci -qm 'rename a to b'
-  $ hg rebase -d 1 --config rebase.experimental.inmemory=yes
+  $ HGNOREALLYONLYINMEMORYREBASE= hg rebase -d 1 --config rebase.experimental.inmemory=yes
   rebasing 2:* "rename a to b" (tip) (glob)
   merging a and b to b
   saved backup bundle to $TESTTMP/rebase-rename/.hg/strip-backup/*-*-rebase.hg (glob)
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1067,6 +1067,8 @@ 
             with ui.configoverride(overrides, b'rebase'):
                 return _dorebase(ui, repo, action, opts, inmemory=inmemory)
         except error.InMemoryMergeConflictsError:
+            if 'HGNOREALLYONLYINMEMORYREBASE' in os.environ:
+                raise
             ui.warn(
                 _(
                     b'hit merge conflicts; re-running rebase without in-memory'