Patchwork D3076: rebase: use single transaction when running in memory

login
register
mail settings
Submitter phabricator
Date April 4, 2018, 5:52 p.m.
Message ID <differential-rev-PHID-DREV-xmfoskv23hpavnfex365-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30267/
State Superseded
Headers show

Comments

phabricator - April 4, 2018, 5:52 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  rebase.singletransaction make rebase noticeably faster (~20% in a test
  I just ran). It is not enabled by default because it risks losing
  information if it aborts (see `hg help rebase`). When running rebase
  with the experimentla in-memory option on, rebase is first attempted
  in memory, and if any conflicts occur, it restarts, this time writing
  to disk. Thus, it should be safe to turn on single-transaction mode
  for the in-memory phase.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - April 4, 2018, 6:18 p.m.
durin42 accepted this revision.
durin42 added a comment.
This revision is now accepted and ready to land.


  fixing typo in log message in flight

REPOSITORY
  rHG Mercurial

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

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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -788,7 +788,9 @@ 
         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, inmemory=inmemory, **opts)
+            overrides = {('rebase', 'singletransaction'): True}
+            with ui.configoverride(overrides, 'rebase'):
+                return _origrebase(ui, repo, inmemory=inmemory, **opts)
         except error.InMemoryMergeConflictsError:
             ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
                       ' merge\n'))