# HG changeset patch # User Martin von Zweigbergk # Date 1522863168 25200 # Node ID b48b7b130d08d40197e5245afcbd4151a0f971c0 # Parent c68262401c8c5fd47e02fd14683581454d794249 rebase: use single transaction when running in memory 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 experimental 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. Differential Revision: https://phab.mercurial-scm.org/D3076 diff -r c68262401c8c -r b48b7b130d08 hgext/rebase.py --- a/hgext/rebase.py Tue Apr 03 13:16:12 2018 -0700 +++ b/hgext/rebase.py Wed Apr 04 10:32:48 2018 -0700 @@ -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'))