comparison hgext/rebase.py @ 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 6f570c501e3e
children 25940470c7e6
comparison
equal deleted inserted replaced
37331:c68262401c8c 37332:b48b7b130d08
786 786
787 if inmemory: 787 if inmemory:
788 try: 788 try:
789 # in-memory merge doesn't support conflicts, so if we hit any, abort 789 # in-memory merge doesn't support conflicts, so if we hit any, abort
790 # and re-run as an on-disk merge. 790 # and re-run as an on-disk merge.
791 return _origrebase(ui, repo, inmemory=inmemory, **opts) 791 overrides = {('rebase', 'singletransaction'): True}
792 with ui.configoverride(overrides, 'rebase'):
793 return _origrebase(ui, repo, inmemory=inmemory, **opts)
792 except error.InMemoryMergeConflictsError: 794 except error.InMemoryMergeConflictsError:
793 ui.warn(_('hit merge conflicts; re-running rebase without in-memory' 795 ui.warn(_('hit merge conflicts; re-running rebase without in-memory'
794 ' merge\n')) 796 ' merge\n'))
795 _origrebase(ui, repo, **{'abort': True}) 797 _origrebase(ui, repo, **{'abort': True})
796 return _origrebase(ui, repo, inmemory=False, **opts) 798 return _origrebase(ui, repo, inmemory=False, **opts)