py3: use bytestr wrapper in revsetlang.formatspec()
This backs out
1c48a8278b2f and wraps expr by bytestr() instead.
--- 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: