comparison mercurial/revsetlang.py @ 31383:7556fe09cc48

py3: convert set of revset initial symbols back to bytes Otherwise tokenize() would fail due to comparison between unicode and bytes.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 12 Mar 2017 17:10:14 -0700
parents 77270ec0cdd9
children fac5cd3b8673
comparison
equal deleted inserted replaced
31382:c9fd842dc886 31383:7556fe09cc48
44 } 44 }
45 45
46 keywords = set(['and', 'or', 'not']) 46 keywords = set(['and', 'or', 'not'])
47 47
48 # default set of valid characters for the initial letter of symbols 48 # default set of valid characters for the initial letter of symbols
49 _syminitletters = set( 49 _syminitletters = set(pycompat.iterbytestr(
50 string.ascii_letters + 50 string.ascii_letters.encode('ascii') +
51 string.digits + pycompat.sysstr('._@')) | set(map(chr, xrange(128, 256))) 51 string.digits.encode('ascii') +
52 '._@')) | set(map(pycompat.bytechr, xrange(128, 256)))
52 53
53 # default set of valid characters for non-initial letters of symbols 54 # default set of valid characters for non-initial letters of symbols
54 _symletters = _syminitletters | set(pycompat.sysstr('-/')) 55 _symletters = _syminitletters | set(pycompat.iterbytestr('-/'))
55 56
56 def tokenize(program, lookup=None, syminitletters=None, symletters=None): 57 def tokenize(program, lookup=None, syminitletters=None, symletters=None):
57 ''' 58 '''
58 Parse a revset statement into a stream of tokens 59 Parse a revset statement into a stream of tokens
59 60