[PATCH] rebase: move actual rebase into a single transaction

Durham Goode durham at fb.com
Sat Mar 4 17:11:53 EST 2017



On 3/4/17 2:08 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1488665211 28800
> #      Sat Mar 04 14:06:51 2017 -0800
> # Node ID 9c3ea2112952f398aaa7625f43dcfa36cfd34379
> # Parent  b4cd912d7704cd976e1bee3a3c927e0e578ec88f
> rebase: move actual rebase into a single transaction
>
> Previously, rebasing would open several transaction over the course of rebasing
> several commits. Opening a transaction can have notable overhead (like copying
> the dirstate) which can add up when rebasing many commits.
>
> This patch adds a single large transaction around the actual commit rebase
> operation, with a catch for intervention which serializes the current state if
> we need to drop back to the terminal for user intervention. Amazingly, almost
> all the tests seem to pass.
>
> On large repos with large working copies, this can speed up rebasing 7 commits
> by 25%. I'd expect the percentage to be a bit larger for rebasing even more
> commits.

This will also help prep us for inmemory rebases, since the concept of 
serializing mid-rebase for user interaction could apply in that case too.


More information about the Mercurial-devel mailing list