##// END OF EJS Templates
revsetlang: do not pass in non-bytes to parse()...
Yuya Nishihara -
r37793:03d7f885 default
parent child Browse files
Show More
@@ -89,6 +89,9 b' def tokenize(program, lookup=None, symin'
89 [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)]
89 [('symbol', '@', 0), ('::', None, 1), ('end', None, 3)]
90
90
91 '''
91 '''
92 if not isinstance(program, bytes):
93 raise error.ProgrammingError('revset statement must be bytes, got %r'
94 % program)
92 program = pycompat.bytestr(program)
95 program = pycompat.bytestr(program)
93 if syminitletters is None:
96 if syminitletters is None:
94 syminitletters = _syminitletters
97 syminitletters = _syminitletters
@@ -581,6 +584,8 b' def _formatargtype(c, arg):'
581 elif c == 's':
584 elif c == 's':
582 return _quote(arg)
585 return _quote(arg)
583 elif c == 'r':
586 elif c == 'r':
587 if not isinstance(arg, bytes):
588 raise TypeError
584 parse(arg) # make sure syntax errors are confined
589 parse(arg) # make sure syntax errors are confined
585 return '(%s)' % arg
590 return '(%s)' % arg
586 elif c == 'n':
591 elif c == 'n':
General Comments 0
You need to be logged in to leave comments. Login now