Re: [PATCH 4 of 4] py3: fix slicing of bytes in revset.formatspec()

2017-03-12 Thread Augie Fackler
On Sun, Mar 12, 2017 at 05:41:56PM -0700, Yuya Nishihara wrote:
> # HG changeset patch
> # User Yuya Nishihara 
> # Date 1489364203 25200
> #  Sun Mar 12 17:16:43 2017 -0700
> # Node ID 3594ddbad77badd70e96afaab32b6a9010406cc3
> # Parent  99d5a74ec8d5fb6396ca940708e4b9922d96edf6
> py3: fix slicing of bytes in revset.formatspec()

queued thanks

>
> diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
> --- a/mercurial/revsetlang.py
> +++ b/mercurial/revsetlang.py
> @@ -644,10 +644,10 @@ def formatspec(expr, *args):
>  pos = 0
>  arg = 0
>  while pos < len(expr):
> -c = expr[pos]
> +c = expr[pos:pos + 1]
>  if c == '%':
>  pos += 1
> -d = expr[pos]
> +d = expr[pos:pos + 1]
>  if d == '%':
>  ret += d
>  elif d in 'dsnbr':
> @@ -656,7 +656,7 @@ def formatspec(expr, *args):
>  elif d == 'l':
>  # a list of some type
>  pos += 1
> -d = expr[pos]
> +d = expr[pos:pos + 1]
>  ret += listexp(list(args[arg]), d)
>  arg += 1
>  else:
> ___
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel


[PATCH 4 of 4] py3: fix slicing of bytes in revset.formatspec()

2017-03-12 Thread Yuya Nishihara
# HG changeset patch
# User Yuya Nishihara 
# Date 1489364203 25200
#  Sun Mar 12 17:16:43 2017 -0700
# Node ID 3594ddbad77badd70e96afaab32b6a9010406cc3
# Parent  99d5a74ec8d5fb6396ca940708e4b9922d96edf6
py3: fix slicing of bytes in revset.formatspec()

diff --git a/mercurial/revsetlang.py b/mercurial/revsetlang.py
--- a/mercurial/revsetlang.py
+++ b/mercurial/revsetlang.py
@@ -644,10 +644,10 @@ def formatspec(expr, *args):
 pos = 0
 arg = 0
 while pos < len(expr):
-c = expr[pos]
+c = expr[pos:pos + 1]
 if c == '%':
 pos += 1
-d = expr[pos]
+d = expr[pos:pos + 1]
 if d == '%':
 ret += d
 elif d in 'dsnbr':
@@ -656,7 +656,7 @@ def formatspec(expr, *args):
 elif d == 'l':
 # a list of some type
 pos += 1
-d = expr[pos]
+d = expr[pos:pos + 1]
 ret += listexp(list(args[arg]), d)
 arg += 1
 else:
___
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel