[PATCH V3] dirstate: track otherparent files same as nonnormal

Durham Goode durham at fb.com
Wed Mar 8 20:38:27 EST 2017

On 3/8/17 5:36 PM, Durham Goode wrote:
> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1489023320 28800
> #      Wed Mar 08 17:35:20 2017 -0800
> # Node ID c1f6f1b0b0d5ca351761f82973860256ad63b16f
> # Parent  150cd51257221fad5ccba5794e7a21837afba479
> dirstate: track otherparent files same as nonnormal
> Calling dirstate.setparents() is expensive in a large repo because it iterates
> over every file in the dirstate. It does so to undo any merge state or
> otherparent state files. Merge state files are already covered by
> dirstate._nonnormalset, so we just need to track otherparent files in a similar
> manner to avoid the full iteration here.
> Fixing this shaves 20-25% off histedit in large repos.
> I tested this by adding temporary debug logic to verify that the old files
> processed in the loop matched the new files processed in the loop and running
> the test suite.

This is the same as the V2 except I kept the old C interface around as 
requested. Building the new .so and running the tests from an old commit 
now works.

More information about the Mercurial-devel mailing list