comparison mercurial/fileset.py @ 32556:1fb0a85fb20e

py3: use pycompat.bytestr so that we don't get ascii values This fixes `hg files 'set:(**.py)'` which makes test-check-py3-compat.t able to run on Python 3. So if you now do `python3 ./run-tests.py test-check-py3-compat`, the test will actually run.
author Pulkit Goyal <7895pulkit@gmail.com>
date Mon, 29 May 2017 16:21:15 +0530
parents bd872f64a8ba
children 0e369eca888f
comparison
equal deleted inserted replaced
32555:9ed70525fd6e 32556:1fb0a85fb20e
12 from .i18n import _ 12 from .i18n import _
13 from . import ( 13 from . import (
14 error, 14 error,
15 merge, 15 merge,
16 parser, 16 parser,
17 pycompat,
17 registrar, 18 registrar,
18 scmutil, 19 scmutil,
19 util, 20 util,
20 ) 21 )
21 22
41 42
42 globchars = ".*{}[]?/\\_" 43 globchars = ".*{}[]?/\\_"
43 44
44 def tokenize(program): 45 def tokenize(program):
45 pos, l = 0, len(program) 46 pos, l = 0, len(program)
47 program = pycompat.bytestr(program)
46 while pos < l: 48 while pos < l:
47 c = program[pos] 49 c = program[pos]
48 if c.isspace(): # skip inter-token whitespace 50 if c.isspace(): # skip inter-token whitespace
49 pass 51 pass
50 elif c in "(),-|&+!": # handle simple operators 52 elif c in "(),-|&+!": # handle simple operators