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
--- 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'))