##// END OF EJS Templates
py3: use bytestr wrapper in revsetlang.formatspec()...
Yuya Nishihara -
r31440:f784ba18 default
parent child Browse files
Show More
@@ -640,14 +640,15 b' def formatspec(expr, *args):'
640 m = l // 2
640 m = l // 2
641 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t))
641 return '(%s or %s)' % (listexp(s[:m], t), listexp(s[m:], t))
642
642
643 expr = pycompat.bytestr(expr)
643 ret = ''
644 ret = ''
644 pos = 0
645 pos = 0
645 arg = 0
646 arg = 0
646 while pos < len(expr):
647 while pos < len(expr):
647 c = expr[pos:pos + 1]
648 c = expr[pos]
648 if c == '%':
649 if c == '%':
649 pos += 1
650 pos += 1
650 d = expr[pos:pos + 1]
651 d = expr[pos]
651 if d == '%':
652 if d == '%':
652 ret += d
653 ret += d
653 elif d in 'dsnbr':
654 elif d in 'dsnbr':
@@ -656,7 +657,7 b' def formatspec(expr, *args):'
656 elif d == 'l':
657 elif d == 'l':
657 # a list of some type
658 # a list of some type
658 pos += 1
659 pos += 1
659 d = expr[pos:pos + 1]
660 d = expr[pos]
660 ret += listexp(list(args[arg]), d)
661 ret += listexp(list(args[arg]), d)
661 arg += 1
662 arg += 1
662 else:
663 else:
General Comments 0
You need to be logged in to leave comments. Login now