Mercurial > hg
comparison mercurial/util.py @ 33619:609606d21765
rebase: use one dirstateguard for when using rebase.singletransaction
This was previously landed as 2519994d25ca but backed out in b63351f6a2 because
it broke hooks mid-rebase and caused conflict resolution data loss in the event
of unexpected exceptions. This new version adds the behavior back but behind a
config flag, since the performance improvement is notable in large repositories.
The old commit message was:
Recently we switched rebases to run the entire rebase inside a single
transaction, which dramatically improved the speed of rebases in repos with
large working copies. Let's also move the dirstate into a single dirstateguard
to get the same benefits. This let's us avoid serializing the dirstate after
each commit.
In a large repo, rebasing 27 commits is sped up by about 20%.
I believe the test changes are because us touching the dirstate gave the
transaction something to actually rollback.
(grafted from 9e3dc3a1638b9754b58a0cb26aaa75d868058109)
(grafted from 7d38b41d2266d9a02a15c64229fae0da5738dcec)
Differential Revision: https://phab.mercurial-scm.org/D135
author | Durham Goode <durham@fb.com> |
---|---|
date | Thu, 20 Jul 2017 01:30:41 -0700 |
parents | 9a2ee9591acc |
children | 1d5e497c08b3 |
comparison
equal
deleted
inserted
replaced
33610:658524d45af0 | 33619:609606d21765 |
---|---|
599 except error.InterventionRequired: | 599 except error.InterventionRequired: |
600 tr.close() | 600 tr.close() |
601 raise | 601 raise |
602 finally: | 602 finally: |
603 tr.release() | 603 tr.release() |
604 | |
605 @contextlib.contextmanager | |
606 def nullcontextmanager(): | |
607 yield | |
604 | 608 |
605 class _lrucachenode(object): | 609 class _lrucachenode(object): |
606 """A node in a doubly linked list. | 610 """A node in a doubly linked list. |
607 | 611 |
608 Holds a reference to nodes on either side as well as a key-value | 612 Holds a reference to nodes on either side as well as a key-value |