[PATCH 4 of 9 sparse] sparse: move config signature logic into core

Martin von Zweigbergk martinvonz at google.com
Thu Jul 6 18:35:41 EDT 2017


On Thu, Jul 6, 2017 at 2:54 PM, Gregory Szorc <gregory.szorc at gmail.com> wrote:
> # HG changeset patch
> # User Gregory Szorc <gregory.szorc at gmail.com>
> # Date 1499377725 25200
> #      Thu Jul 06 14:48:45 2017 -0700
> # Node ID b9d7f9e9fd096f795314ad9ccaea85139df47997
> # Parent  7bd81df5813100a0a28ac2373722cd6405b5c505
> sparse: move config signature logic into core
>
> The implementation changed slightly. Before, 0 was being used as
> the default value and we cast the int to a string. We also
> handled I/O exceptions manually. The new code uses vfs.tryread()
> so we always feed data into the hasher. The empty string does hash
> and this should result in identical behavior in terms of the
> result being suitable for a cache key. We just avoid the
> I/O exceptions and type coercion. This made the code simple enough
> that the separate checksum function could be inlined.

Queued patches 1-3. As I mentioned on IRC, this one got a little large
with both move and refactoring in one to follow (both versions don't
even fit on one page of my terminal, so comparing gets hard). Please
split up move and refactoring (I don't really care whether you move or
refactor first).


More information about the Mercurial-devel mailing list