Patchwork D2664: py3: use b"%d" instead of str() to convert integers to bytes

login
register
mail settings
Submitter phabricator
Date March 4, 2018, 7:40 p.m.
Message ID <differential-rev-PHID-DREV-2ohkwilwunpqq4jk5ht3-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/28976/
State Superseded
Headers show

Comments

phabricator - March 4, 2018, 7:40 p.m.
pulkit created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D2664

AFFECTED FILES
  mercurial/context.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -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