[PATCH 1 of 3] dirstate: change placeholder hash length to 20 bytes

Sean Farley sean at farley.io
Thu Nov 10 13:07:25 EST 2016


Durham Goode <durham at fb.com> writes:

> # HG changeset patch
> # User Durham Goode <durham at fb.com>
> # Date 1478773042 28800
> #      Thu Nov 10 02:17:22 2016 -0800
> # Node ID 84d7edbc0712c8c71b5e32c9cc1ee04032b9eb2d
> # Parent  3fd53cc1aad882ac9191d7388885acdbbc2d7103
> dirstate: change placeholder hash length to 20 bytes
>
> Previously the new-node placeholder hash for manifests generated from the
> dirstate was a 21byte long string of "!" characters. Normal hashes are only 20
> bytes long.  This makes it complicated to implement more efficient manifest
> implementations which rely on the hashes being fixed length.
>
> Let's change this hash to just be 20 bytes long, and rely on the astronomical
> improbability of an actual hash being 20 "!" bytes in a row (just like we rely
> on no hash ever being the nullid).

Will this cause a problem for a user that has a 21-length dirstate entry
then upgrades Mercurial?


More information about the Mercurial-devel mailing list