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

pulkit (Pulkit Goyal) phabricator at mercurial-scm.org
Sun Mar 4 19:40:32 UTC 2018


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

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



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


More information about the Mercurial-devel mailing list