Mercurial > hg-stable
changeset 31449:f784ba187089
py3: use bytestr wrapper in revsetlang.formatspec()
This backs out 1c48a8278b2f and wraps expr by bytestr() instead.
author | Yuya Nishihara <yuya@tcha.org> |
---|---|
date | Thu, 16 Mar 2017 21:33:25 +0900 |
parents | b70407bd84d5 |
children | 80c8a6db450d |
files | mercurial/revsetlang.py |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/revsetlang.py Wed Mar 08 22:48:26 2017 +0900 +++ b/mercurial/revsetlang.py Thu Mar 16 21:33:25 2017 +0900 @@ -640,14 +640,15 @@ m = l // 2 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t)) + expr = pycompat.bytestr(expr) ret = '' pos = 0 arg = 0 while pos < len(expr): - c = expr[pos:pos + 1] + c = expr[pos] if c == '%': pos += 1 - d = expr[pos:pos + 1] + d = expr[pos] if d == '%': ret += d elif d in 'dsnbr': @@ -656,7 +657,7 @@ elif d == 'l': # a list of some type pos += 1 - d = expr[pos:pos + 1] + d = expr[pos] ret += listexp(list(args[arg]), d) arg += 1 else: