py3: use b"%d" instead of str() to convert integers to bytes
Differential Revision: https://phab.mercurial-scm.org/D2664
--- a/mercurial/context.py Mon Mar 05 01:03:23 2018 +0530
+++ b/mercurial/context.py Mon Mar 05 01:05:54 2018 +0530
@@ -433,7 +433,7 @@
self._rev = changeid
return
if not pycompat.ispy3 and isinstance(changeid, long):
- changeid = str(changeid)
+ changeid = "%d" % changeid
if changeid == 'null':
self._node = nullid
self._rev = nullrev
--- a/mercurial/revlog.py Mon Mar 05 01:03:23 2018 +0530
+++ b/mercurial/revlog.py Mon Mar 05 01:05:54 2018 +0530
@@ -1367,7 +1367,7 @@
try:
# str(rev)
rev = int(id)
- if str(rev) != id:
+ if "%d" % rev != id:
raise ValueError
if rev < 0:
rev = len(self) + rev