##// END OF EJS Templates
revset: build _syminitletters from a saner source: the string module...
Augie Fackler -
r30071:2def3d55 default
parent child Browse files
Show More
@@ -9,6 +9,7 b' from __future__ import absolute_import'
9
9
10 import heapq
10 import heapq
11 import re
11 import re
12 import string
12
13
13 from .i18n import _
14 from .i18n import _
14 from . import (
15 from . import (
@@ -22,6 +23,7 b' from . import ('
22 parser,
23 parser,
23 pathutil,
24 pathutil,
24 phases,
25 phases,
26 pycompat,
25 registrar,
27 registrar,
26 repoview,
28 repoview,
27 util,
29 util,
@@ -173,11 +175,12 b' elements = {'
173 keywords = set(['and', 'or', 'not'])
175 keywords = set(['and', 'or', 'not'])
174
176
175 # default set of valid characters for the initial letter of symbols
177 # default set of valid characters for the initial letter of symbols
176 _syminitletters = set(c for c in [chr(i) for i in xrange(256)]
178 _syminitletters = set(
177 if c.isalnum() or c in '._@' or ord(c) > 127)
179 string.ascii_letters +
180 string.digits + pycompat.sysstr('._@')) | set(map(chr, xrange(128, 256)))
178
181
179 # default set of valid characters for non-initial letters of symbols
182 # default set of valid characters for non-initial letters of symbols
180 _symletters = _syminitletters | set('-/')
183 _symletters = _syminitletters | set(pycompat.sysstr('-/'))
181
184
182 def tokenize(program, lookup=None, syminitletters=None, symletters=None):
185 def tokenize(program, lookup=None, syminitletters=None, symletters=None):
183 '''
186 '''
@@ -2619,8 +2622,7 b' def optimize(tree):'
2619
2622
2620 # the set of valid characters for the initial letter of symbols in
2623 # the set of valid characters for the initial letter of symbols in
2621 # alias declarations and definitions
2624 # alias declarations and definitions
2622 _aliassyminitletters = set(c for c in [chr(i) for i in xrange(256)]
2625 _aliassyminitletters = _syminitletters | set(pycompat.sysstr('$'))
2623 if c.isalnum() or c in '._@$' or ord(c) > 127)
2624
2626
2625 def _parsewith(spec, lookup=None, syminitletters=None):
2627 def _parsewith(spec, lookup=None, syminitletters=None):
2626 """Generate a parse tree of given spec with given tokenizing options
2628 """Generate a parse tree of given spec with given tokenizing options
@@ -120,35 +120,33 b''
120 mercurial/httppeer.py: error importing: <TypeError> Can't mix strings and bytes in path components (error at i18n.py:*)
120 mercurial/httppeer.py: error importing: <TypeError> Can't mix strings and bytes in path components (error at i18n.py:*)
121 mercurial/i18n.py: error importing module: <TypeError> bytes expected, not str (line *)
121 mercurial/i18n.py: error importing module: <TypeError> bytes expected, not str (line *)
122 mercurial/keepalive.py: error importing module: <AttributeError> module 'mercurial.util' has no attribute 'httplib' (line *)
122 mercurial/keepalive.py: error importing module: <AttributeError> module 'mercurial.util' has no attribute 'httplib' (line *)
123 mercurial/localrepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
123 mercurial/localrepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at httpconnection.py:*)
124 mercurial/mail.py: error importing module: <AttributeError> module 'email' has no attribute 'Header' (line *)
124 mercurial/mail.py: error importing module: <AttributeError> module 'email' has no attribute 'Header' (line *)
125 mercurial/manifest.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
125 mercurial/manifest.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
126 mercurial/merge.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
126 mercurial/merge.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
127 mercurial/namespaces.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
127 mercurial/namespaces.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
128 mercurial/patch.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
128 mercurial/patch.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
129 mercurial/pvec.py: error importing module: <NameError> name 'xrange' is not defined (line *)
129 mercurial/pvec.py: error importing module: <NameError> name 'xrange' is not defined (line *)
130 mercurial/repair.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
130 mercurial/repair.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at httpconnection.py:*)
131 mercurial/revlog.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
131 mercurial/revlog.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
132 mercurial/revset.py: error importing module: <NameError> name 'xrange' is not defined (line *)
132 mercurial/revset.py: error importing module: <AttributeError> 'dict' object has no attribute 'iteritems' (line *)
133 mercurial/scmutil.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
134 mercurial/scmwindows.py: error importing module: <ImportError> No module named 'winreg' (line *)
133 mercurial/scmwindows.py: error importing module: <ImportError> No module named 'winreg' (line *)
135 mercurial/simplemerge.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
134 mercurial/sshpeer.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at httpconnection.py:*)
136 mercurial/sshpeer.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
135 mercurial/sshserver.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
137 mercurial/sshserver.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
138 mercurial/statichttprepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at byterange.py:*)
136 mercurial/statichttprepo.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at byterange.py:*)
139 mercurial/store.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
137 mercurial/store.py: error importing module: <NameError> name 'xrange' is not defined (line *)
140 mercurial/streamclone.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
138 mercurial/streamclone.py: error importing: <TypeError> can't concat bytes to str (error at store.py:*)
141 mercurial/subrepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
139 mercurial/subrepo.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
142 mercurial/templatefilters.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
140 mercurial/templatefilters.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
143 mercurial/templatekw.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
141 mercurial/templatekw.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
144 mercurial/templater.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
142 mercurial/templater.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
145 mercurial/ui.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
143 mercurial/ui.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
146 mercurial/unionrepo.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
144 mercurial/unionrepo.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
147 mercurial/url.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at httpconnection.py:*)
145 mercurial/url.py: error importing: <AttributeError> module 'mercurial.util' has no attribute 'urlerr' (error at httpconnection.py:*)
148 mercurial/verify.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
146 mercurial/verify.py: error importing: <AttributeError> module 'email' has no attribute 'Header' (error at mail.py:*)
149 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
147 mercurial/win32.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
150 mercurial/windows.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
148 mercurial/windows.py: error importing module: <ImportError> No module named 'msvcrt' (line *)
151 mercurial/wireproto.py: error importing: <TypeError> a bytes-like object is required, not 'str' (error at revset.py:*)
149 mercurial/wireproto.py: error importing: <TypeError> %b requires bytes, or an object that implements __bytes__, not 'str' (error at bundle2.py:*)
152
150
153 #endif
151 #endif
154
152
General Comments 0
You need to be logged in to leave comments. Login now