Show More
@@ -262,7 +262,7 def globre(pat, head='^', tail='$'): | |||
|
262 | 262 | "convert a glob pattern into a regexp" |
|
263 | 263 | i, n = 0, len(pat) |
|
264 | 264 | res = '' |
|
265 |
group = |
|
|
265 | group = 0 | |
|
266 | 266 | def peek(): return i < n and pat[i] |
|
267 | 267 | while i < n: |
|
268 | 268 | c = pat[i] |
@@ -292,11 +292,11 def globre(pat, head='^', tail='$'): | |||
|
292 | 292 | stuff = '\\' + stuff |
|
293 | 293 | res = '%s[%s]' % (res, stuff) |
|
294 | 294 | elif c == '{': |
|
295 |
group = |
|
|
295 | group += 1 | |
|
296 | 296 | res += '(?:' |
|
297 | 297 | elif c == '}' and group: |
|
298 | 298 | res += ')' |
|
299 |
group = |
|
|
299 | group -= 1 | |
|
300 | 300 | elif c == ',' and group: |
|
301 | 301 | res += '|' |
|
302 | 302 | elif c == '\\': |
@@ -58,6 +58,7 debugwalk .hg | |||
|
58 | 58 | debugwalk ../.hg |
|
59 | 59 | chdir .. |
|
60 | 60 | debugwalk -Ibeans |
|
61 | debugwalk -I '{*,{b,m}*/*}k' | |
|
61 | 62 | debugwalk 'glob:mammals/../beans/b*' |
|
62 | 63 | debugwalk '-X*/Procyonidae' mammals |
|
63 | 64 | debugwalk path:mammals |
@@ -174,6 +174,11 f beans/navy beans/navy | |||
|
174 | 174 | f beans/pinto beans/pinto |
|
175 | 175 | f beans/turtle beans/turtle |
|
176 | 176 | |
|
177 | hg debugwalk -I {*,{b,m}*/*}k | |
|
178 | f beans/black beans/black | |
|
179 | f fenugreek fenugreek | |
|
180 | f mammals/skunk mammals/skunk | |
|
181 | ||
|
177 | 182 | hg debugwalk glob:mammals/../beans/b* |
|
178 | 183 | f beans/black beans/black |
|
179 | 184 | f beans/borlotti beans/borlotti |
General Comments 0
You need to be logged in to leave comments.
Login now