Patchwork [3,of,4,py3] revsetlang: portably turn int into bytestring

login
register
mail settings
Submitter Augie Fackler
Date March 21, 2017, 7:13 p.m.
Message ID <3af735529b5f475e5c53.1490123582@arthedain.pit.corp.google.com>
Download mbox | patch
Permalink /patch/19537/
State Accepted
Headers show

Comments

Augie Fackler - March 21, 2017, 7:13 p.m.
# HG changeset patch
# User Augie Fackler <augie@google.com>
# Date 1489899833 14400
#      Sun Mar 19 01:03:53 2017 -0400
# Node ID 3af735529b5f475e5c53ffaf7b136eecb97fcd61
# Parent  63466a54ec9e266031cce12fbd699ccfccd40738
revsetlang: portably turn int into bytestring
Yuya Nishihara - March 22, 2017, 1:42 p.m.
On Tue, 21 Mar 2017 15:13:02 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <augie@google.com>
> # Date 1489899833 14400
> #      Sun Mar 19 01:03:53 2017 -0400
> # Node ID 3af735529b5f475e5c53ffaf7b136eecb97fcd61
> # Parent  63466a54ec9e266031cce12fbd699ccfccd40738
> revsetlang: portably turn int into bytestring

Queued this, thanks.

Patch

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -633,7 +633,7 @@  def formatspec(expr, *args):
         elif l == 1:
             return argtype(t, s[0])
         elif t == 'd':
-            return "_intlist('%s')" % "\0".join(str(int(a)) for a in s)
+            return "_intlist('%s')" % "\0".join('%d' % int(a) for a in s)
         elif t == 's':
             return "_list('%s')" % "\0".join(s)
         elif t == 'n':