[PATCH 7 of 7] largefiles: use readasstandin() to read hex hash directly from filectx

Yuya Nishihara yuya at tcha.org
Sun Apr 2 00:44:26 EDT 2017


On Sat, 01 Apr 2017 02:41:52 +0900, FUJIWARA Katsunori wrote:
> # HG changeset patch
> # User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
> # Date 1490981569 -32400
> #      Sat Apr 01 02:32:49 2017 +0900
> # Node ID bd7e74372d5d3763b38717159a805cf557b07604
> # Parent  89507622f5b4cb8b8e9f99a02db43b64f10d95f3
> largefiles: use readasstandin() to read hex hash directly from filectx

Queued, thanks.

> BTW, C implementation of hexdigest() for SHA-1/256/512 returns hex
> hash in lower case, and doctest in Python standard hashlib assumes
> that, too. But it isn't explicitly described in API document or so.
> 
> Therefore, we can't assume that hexdigest() always returns hex hash in
> lower case, for any hash algorithms, on any Python runtimes and
> versions.

[...]

We'll need to stop using .hexdigest() for Py3 compatibility anyway, and
use node.hex() instead. node.hex() isn't documented to return lowercase
hex, but everything would be broken if it doesn't.


More information about the Mercurial-devel mailing list