Patchwork D3280: py3: use b'%d' to convert int to bytes instead of str()

login
register
mail settings
Submitter phabricator
Date April 12, 2018, 12:07 p.m.
Message ID <differential-rev-PHID-DREV-qviphnyxiqulyjsharqg-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/30779/
State Superseded
Headers show

Comments

phabricator - April 12, 2018, 12:07 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/D3280

AFFECTED FILES
  hgext/convert/git.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/convert/git.py b/hgext/convert/git.py
--- a/hgext/convert/git.py
+++ b/hgext/convert/git.py
@@ -372,7 +372,7 @@ 
 
         tzs, tzh, tzm = tz[-5:-4] + "1", tz[-4:-2], tz[-2:]
         tz = -int(tzs) * (int(tzh) * 3600 + int(tzm))
-        date = tm + " " + str(tz)
+        date = tm + " " + (b"%d" % tz)
         saverev = self.ui.configbool('convert', 'git.saverev')
 
         c = common.commit(parents=parents, date=date, author=author,