( )⚙ D271 obsolete: use bytes() instead of str() so the node is bytes on py3

This is an archive of the discontinued Mercurial Phabricator instance.

obsolete: use bytes() instead of str() so the node is bytes on py3
ClosedPublic

Authored by durin42 on Aug 8 2017, 3:49 PM.

Details

Summary

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.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

durin42 created this revision.Aug 8 2017, 3:49 PM
quark accepted this revision.Aug 9 2017, 1:12 AM
yuja added a subscriber: yuja.Aug 9 2017, 9:57 AM
yuja added inline comments.
mercurial/obsolete.py
587

Why can't this be just bytes(prec) ?

I don't think str(prec).encode('ascii') is valid for binary node id.

durin42 retitled this revision from obsolete: use bytestr() instead of str() so the node is bytes on py3 to obsolete: use bytes() instead of str() so the node is bytes on py3.Aug 9 2017, 10:24 AM
durin42 updated this revision to Diff 675.
durin42 marked an inline comment as done.Aug 9 2017, 10:24 AM
durin42 added inline comments.
mercurial/obsolete.py
587

I swear that didn't work before. But it does work, so yay!

durin42 marked an inline comment as done.Aug 9 2017, 10:51 AM
This revision was automatically updated to reflect the committed changes.