Patchwork [01,of,11] revsetlang: fix _quote on int on python3

login
register
mail settings
Submitter Augie Fackler
Date March 26, 2017, 10:36 p.m.
Message ID <1250b7d77ba41c7ce150.1490567795@imladris.local>
Download mbox | patch
Permalink /patch/19701/
State Accepted
Headers show

Comments

Augie Fackler - March 26, 2017, 10:36 p.m.
# HG changeset patch
# User Augie Fackler <raf@durin42.com>
# Date 1490561309 14400
#      Sun Mar 26 16:48:29 2017 -0400
# Node ID 1250b7d77ba41c7ce1500d4c8e5fef921a14f683
# Parent  e86eb75e74ce1b0803c26d86a229b9b711f6d76a
revsetlang: fix _quote on int on python3

Thanks to Yuya for spotting the need.
Pulkit Goyal - March 27, 2017, 6:26 a.m.
Yuya earlier had a similar series for fixing second commit. That series and
this series have few patches similar and for few patches there are
different approaches. I have commented on individual patches with Yuya's
patch link from patchwork so that both of you can review and push things
easily.

On Mon, Mar 27, 2017 at 4:06 AM, Augie Fackler <raf@durin42.com> wrote:

> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1490561309 14400
> #      Sun Mar 26 16:48:29 2017 -0400
> # Node ID 1250b7d77ba41c7ce1500d4c8e5fef921a14f683
> # Parent  e86eb75e74ce1b0803c26d86a229b9b711f6d76a
> revsetlang: fix _quote on int on python3
>
> Thanks to Yuya for spotting the need.
>
> diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
> --- a/mercurial/revsetlang.py
> +++ b/mercurial/revsetlang.py
> @@ -586,7 +586,7 @@ def _quote(s):
>      >>> _quote(1)
>      "'1'"
>      """
> -    return "'%s'" % util.escapestr('%s' % s)
> +    return "'%s'" % util.escapestr(pycompat.bytestr(s))
>
>  def formatspec(expr, *args):
>      '''
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Yuya Nishihara - March 27, 2017, 1:10 p.m.
On Sun, 26 Mar 2017 18:36:35 -0400, Augie Fackler wrote:
> # HG changeset patch
> # User Augie Fackler <raf@durin42.com>
> # Date 1490561309 14400
> #      Sun Mar 26 16:48:29 2017 -0400
> # Node ID 1250b7d77ba41c7ce1500d4c8e5fef921a14f683
> # Parent  e86eb75e74ce1b0803c26d86a229b9b711f6d76a
> revsetlang: fix _quote on int on python3

Queued this one, thanks.

Patch

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -586,7 +586,7 @@  def _quote(s):
     >>> _quote(1)
     "'1'"
     """
-    return "'%s'" % util.escapestr('%s' % s)
+    return "'%s'" % util.escapestr(pycompat.bytestr(s))
 
 def formatspec(expr, *args):
     '''