Mercurial > hg-stable
changeset 37332:b48b7b130d08
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
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Wed, 04 Apr 2018 10:32:48 -0700 |
parents | c68262401c8c |
children | 44f3b60deafb |
files | hgext/rebase.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- 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'))