[PATCH 03 of 10 py3] obsolete: use bytestr() instead of str() so the node is bytes on py3

Augie Fackler raf at durin42.com
Wed Aug 2 11:37:45 EDT 2017


> On Aug 2, 2017, at 11:11, Yuya Nishihara <yuya at tcha.org> wrote:
> 
> On Tue, 01 Aug 2017 16:34:31 -0400, Augie Fackler wrote:
>> # HG changeset patch
>> # User Augie Fackler <augie at google.com>
>> # Date 1500907059 14400
>> #      Mon Jul 24 10:37:39 2017 -0400
>> # Node ID f50da59f7977c7d796850b95ac7c80a4fd92bd18
>> # Parent  8b22554199879f80a13ddee556bc540ddcb65a94
>> obsolete: use bytestr() instead of str() so the node is bytes on py3
>> 
>> I'm not sure this is right, since this should either be bytes or str
>> to match what's going on in the revlog layer.
> 
> Sounds like a bug of revlog. 'prec' should be a binary node id, which can't
> be a unicode string.

I think in some cases prec coming in as something that __str__ or __repr__s down to a valid node id, which is why the str() is here. It definitely breaks if you just remove the str().

> 
>> -        marker = (str(prec), tuple(succs), int(flag), metadata, date, parents)
>> +        prec = bytes(pycompat.bytestr(prec))
>> +        marker = (prec, tuple(succs), int(flag), metadata, date, parents)



More information about the Mercurial-devel mailing list