py3: use %d to format integers into bytestrings
authorPulkit Goyal <7895pulkit@gmail.com>
Fri, 05 May 2017 01:41:54 +0530
changeset 32155 055cca8e167b
parent 32154 52e222eef646
child 32156 6c0ae9683437
py3: use %d to format integers into bytestrings
hgext/blackbox.py
mercurial/cmdutil.py
--- a/hgext/blackbox.py	Fri May 05 01:26:49 2017 +0530
+++ b/hgext/blackbox.py	Fri May 05 01:41:54 2017 +0530
@@ -173,7 +173,7 @@
                 ui._bbinlog = True
                 date = util.datestr(None, '%Y/%m/%d %H:%M:%S')
                 user = util.getuser()
-                pid = str(util.getpid())
+                pid = '%d' % util.getpid()
                 formattedmsg = msg[0] % msg[1:]
                 rev = '(unknown)'
                 changed = ''
--- a/mercurial/cmdutil.py	Fri May 05 01:26:49 2017 +0530
+++ b/mercurial/cmdutil.py	Fri May 05 01:41:54 2017 +0530
@@ -1361,7 +1361,7 @@
         if rev is None:
             jrev = jnode = 'null'
         else:
-            jrev = str(rev)
+            jrev = '%d' % rev
             jnode = '"%s"' % hex(ctx.node())
         j = encoding.jsonescape
 
@@ -1608,7 +1608,7 @@
         if rev in results:
             ui.status(_("found revision %s from %s\n") %
                       (rev, util.datestr(results[rev])))
-            return str(rev)
+            return '%d' % rev
 
     raise error.Abort(_("revision matching date not found"))