Show More
@@ -145,9 +145,9 b' def match(root, cwd, patterns, include=N' | |||
|
145 | 145 | if exact: |
|
146 | 146 | m = exactmatcher(root, cwd, patterns, badfn) |
|
147 | 147 | else: |
|
148 |
m = patternmatcher(root, cwd, normalize, patterns, |
|
|
149 |
|
|
|
150 |
|
|
|
148 | m = patternmatcher(root, cwd, normalize, patterns, default=default, | |
|
149 | auditor=auditor, ctx=ctx, listsubrepos=listsubrepos, | |
|
150 | warn=warn, badfn=badfn) | |
|
151 | 151 | if include: |
|
152 | 152 | im = includematcher(root, cwd, normalize, include, auditor=auditor, |
|
153 | 153 | ctx=ctx, listsubrepos=listsubrepos, warn=warn, |
@@ -313,36 +313,17 b' class basematcher(object):' | |||
|
313 | 313 | |
|
314 | 314 | class patternmatcher(basematcher): |
|
315 | 315 | |
|
316 |
def __init__(self, root, cwd, normalize, patterns, |
|
|
317 |
|
|
|
318 |
|
|
|
316 | def __init__(self, root, cwd, normalize, patterns, default='glob', | |
|
317 | auditor=None, ctx=None, listsubrepos=False, warn=None, | |
|
318 | badfn=None): | |
|
319 | 319 | super(patternmatcher, self).__init__(root, cwd, badfn, |
|
320 |
relativeuipath=bool( |
|
|
321 | patterns)) | |
|
322 | if include is None: | |
|
323 | include = [] | |
|
320 | relativeuipath=bool(patterns)) | |
|
324 | 321 | |
|
325 |
self._anypats = |
|
|
326 | self._anyincludepats = False | |
|
322 | self._anypats = False | |
|
327 | 323 | self._always = False |
|
328 | 324 | self.patternspat = None |
|
329 | self.includepat = None | |
|
330 | ||
|
331 | # roots are directories which are recursively included. | |
|
332 | self._includeroots = set() | |
|
333 | # dirs are directories which are non-recursively included. | |
|
334 | self._includedirs = set() | |
|
335 | 325 | |
|
336 | 326 | matchfns = [] |
|
337 | if include: | |
|
338 | kindpats = normalize(include, 'glob', root, cwd, auditor, warn) | |
|
339 | self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)', | |
|
340 | listsubrepos, root) | |
|
341 | self._anyincludepats = _anypats(kindpats) | |
|
342 | roots, dirs = _rootsanddirs(kindpats) | |
|
343 | self._includeroots.update(roots) | |
|
344 | self._includedirs.update(dirs) | |
|
345 | matchfns.append(im) | |
|
346 | 327 | if patterns: |
|
347 | 328 | kindpats = normalize(patterns, default, root, cwd, auditor, warn) |
|
348 | 329 | if not _kindpatsalwaysmatch(kindpats): |
@@ -373,17 +354,6 b' class patternmatcher(basematcher):' | |||
|
373 | 354 | def visitdir(self, dir): |
|
374 | 355 | if self.prefix() and dir in self._fileset: |
|
375 | 356 | return 'all' |
|
376 | if self._includeroots or self._includedirs: | |
|
377 | if (not self._anyincludepats and | |
|
378 | dir in self._includeroots): | |
|
379 | # The condition above is essentially self.prefix() for includes | |
|
380 | return 'all' | |
|
381 | if ('.' not in self._includeroots and | |
|
382 | dir not in self._includeroots and | |
|
383 | dir not in self._includedirs and | |
|
384 | not any(parent in self._includeroots | |
|
385 | for parent in util.finddirs(dir))): | |
|
386 | return False | |
|
387 | 357 | return (not self._fileset or |
|
388 | 358 | '.' in self._fileset or |
|
389 | 359 | dir in self._fileset or |
@@ -398,8 +368,7 b' class patternmatcher(basematcher):' | |||
|
398 | 368 | return self._always |
|
399 | 369 | |
|
400 | 370 | def __repr__(self): |
|
401 |
return ('<patternmatcher patterns=%r |
|
|
402 | (self.patternspat, self.includepat)) | |
|
371 | return ('<patternmatcher patterns=%r>' % self.patternspat) | |
|
403 | 372 | |
|
404 | 373 | class includematcher(basematcher): |
|
405 | 374 |
@@ -33,7 +33,7 b' test issue352' | |||
|
33 | 33 | [255] |
|
34 | 34 | $ echo foo > "$A" |
|
35 | 35 | $ hg debugwalk |
|
36 |
matcher: <patternmatcher patterns=None |
|
|
36 | matcher: <patternmatcher patterns=None> | |
|
37 | 37 | f he\r (no-eol) (esc) |
|
38 | 38 | llo he\r (no-eol) (esc) |
|
39 | 39 | llo |
@@ -29,7 +29,7 b'' | |||
|
29 | 29 | $ hg commit -m "commit #0" |
|
30 | 30 | |
|
31 | 31 | $ hg debugwalk |
|
32 |
matcher: <patternmatcher patterns=None |
|
|
32 | matcher: <patternmatcher patterns=None> | |
|
33 | 33 | f beans/black beans/black |
|
34 | 34 | f beans/borlotti beans/borlotti |
|
35 | 35 | f beans/kidney beans/kidney |
@@ -61,7 +61,7 b'' | |||
|
61 | 61 | |
|
62 | 62 | $ cd mammals |
|
63 | 63 | $ hg debugwalk |
|
64 |
matcher: <patternmatcher patterns=None |
|
|
64 | matcher: <patternmatcher patterns=None> | |
|
65 | 65 | f beans/black ../beans/black |
|
66 | 66 | f beans/borlotti ../beans/borlotti |
|
67 | 67 | f beans/kidney ../beans/kidney |
@@ -76,7 +76,7 b'' | |||
|
76 | 76 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
|
77 | 77 | f mammals/skunk skunk |
|
78 | 78 | $ hg debugwalk -X ../beans |
|
79 |
matcher: <differencematcher m1=<patternmatcher patterns=None |
|
|
79 | matcher: <differencematcher m1=<patternmatcher patterns=None>, m2=<includematcher includes='(?:beans(?:/|$))'>> | |
|
80 | 80 | f fennel ../fennel |
|
81 | 81 | f fenugreek ../fenugreek |
|
82 | 82 | f fiddlehead ../fiddlehead |
@@ -96,7 +96,7 b'' | |||
|
96 | 96 | f fenugreek ../fenugreek |
|
97 | 97 | f mammals/skunk skunk |
|
98 | 98 | $ hg debugwalk -I 'relglob:*k' . |
|
99 |
matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
99 | matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:(?:|.*/)[^/]*k(?:/|$))'>> | |
|
100 | 100 | f mammals/skunk skunk |
|
101 | 101 | $ hg debugwalk -I 're:.*k$' |
|
102 | 102 | matcher: <includematcher includes='(?:.*k$)'> |
@@ -126,7 +126,7 b'' | |||
|
126 | 126 | f beans/turtle ../beans/turtle |
|
127 | 127 | |
|
128 | 128 | $ hg debugwalk 'rootfilesin:' |
|
129 |
matcher: <patternmatcher patterns='(?:^[^/]+$)' |
|
|
129 | matcher: <patternmatcher patterns='(?:^[^/]+$)'> | |
|
130 | 130 | f fennel ../fennel |
|
131 | 131 | f fenugreek ../fenugreek |
|
132 | 132 | f fiddlehead ../fiddlehead |
@@ -136,7 +136,7 b'' | |||
|
136 | 136 | f fenugreek ../fenugreek |
|
137 | 137 | f fiddlehead ../fiddlehead |
|
138 | 138 | $ hg debugwalk 'rootfilesin:.' |
|
139 |
matcher: <patternmatcher patterns='(?:^[^/]+$)' |
|
|
139 | matcher: <patternmatcher patterns='(?:^[^/]+$)'> | |
|
140 | 140 | f fennel ../fennel |
|
141 | 141 | f fenugreek ../fenugreek |
|
142 | 142 | f fiddlehead ../fiddlehead |
@@ -146,7 +146,7 b'' | |||
|
146 | 146 | f fenugreek ../fenugreek |
|
147 | 147 | f fiddlehead ../fiddlehead |
|
148 | 148 | $ hg debugwalk -X 'rootfilesin:' |
|
149 |
matcher: <differencematcher m1=<patternmatcher patterns=None |
|
|
149 | matcher: <differencematcher m1=<patternmatcher patterns=None>, m2=<includematcher includes='(?:^[^/]+$)'>> | |
|
150 | 150 | f beans/black ../beans/black |
|
151 | 151 | f beans/borlotti ../beans/borlotti |
|
152 | 152 | f beans/kidney ../beans/kidney |
@@ -158,15 +158,15 b'' | |||
|
158 | 158 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
|
159 | 159 | f mammals/skunk skunk |
|
160 | 160 | $ hg debugwalk 'rootfilesin:fennel' |
|
161 |
matcher: <patternmatcher patterns='(?:^fennel/[^/]+$)' |
|
|
161 | matcher: <patternmatcher patterns='(?:^fennel/[^/]+$)'> | |
|
162 | 162 | $ hg debugwalk -I 'rootfilesin:fennel' |
|
163 | 163 | matcher: <includematcher includes='(?:^fennel/[^/]+$)'> |
|
164 | 164 | $ hg debugwalk 'rootfilesin:skunk' |
|
165 |
matcher: <patternmatcher patterns='(?:^skunk/[^/]+$)' |
|
|
165 | matcher: <patternmatcher patterns='(?:^skunk/[^/]+$)'> | |
|
166 | 166 | $ hg debugwalk -I 'rootfilesin:skunk' |
|
167 | 167 | matcher: <includematcher includes='(?:^skunk/[^/]+$)'> |
|
168 | 168 | $ hg debugwalk 'rootfilesin:beans' |
|
169 |
matcher: <patternmatcher patterns='(?:^beans/[^/]+$)' |
|
|
169 | matcher: <patternmatcher patterns='(?:^beans/[^/]+$)'> | |
|
170 | 170 | f beans/black ../beans/black |
|
171 | 171 | f beans/borlotti ../beans/borlotti |
|
172 | 172 | f beans/kidney ../beans/kidney |
@@ -182,19 +182,19 b'' | |||
|
182 | 182 | f beans/pinto ../beans/pinto |
|
183 | 183 | f beans/turtle ../beans/turtle |
|
184 | 184 | $ hg debugwalk 'rootfilesin:mammals' |
|
185 |
matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)' |
|
|
185 | matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)'> | |
|
186 | 186 | f mammals/skunk skunk |
|
187 | 187 | $ hg debugwalk -I 'rootfilesin:mammals' |
|
188 | 188 | matcher: <includematcher includes='(?:^mammals/[^/]+$)'> |
|
189 | 189 | f mammals/skunk skunk |
|
190 | 190 | $ hg debugwalk 'rootfilesin:mammals/' |
|
191 |
matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)' |
|
|
191 | matcher: <patternmatcher patterns='(?:^mammals/[^/]+$)'> | |
|
192 | 192 | f mammals/skunk skunk |
|
193 | 193 | $ hg debugwalk -I 'rootfilesin:mammals/' |
|
194 | 194 | matcher: <includematcher includes='(?:^mammals/[^/]+$)'> |
|
195 | 195 | f mammals/skunk skunk |
|
196 | 196 | $ hg debugwalk -X 'rootfilesin:mammals' |
|
197 |
matcher: <differencematcher m1=<patternmatcher patterns=None |
|
|
197 | matcher: <differencematcher m1=<patternmatcher patterns=None>, m2=<includematcher includes='(?:^mammals/[^/]+$)'>> | |
|
198 | 198 | f beans/black ../beans/black |
|
199 | 199 | f beans/borlotti ../beans/borlotti |
|
200 | 200 | f beans/kidney ../beans/kidney |
@@ -209,7 +209,7 b'' | |||
|
209 | 209 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
|
210 | 210 | |
|
211 | 211 | $ hg debugwalk . |
|
212 |
matcher: <patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
212 | matcher: <patternmatcher patterns='(?:mammals(?:/|$))'> | |
|
213 | 213 | f mammals/Procyonidae/cacomistle Procyonidae/cacomistle |
|
214 | 214 | f mammals/Procyonidae/coatimundi Procyonidae/coatimundi |
|
215 | 215 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
@@ -221,19 +221,19 b'' | |||
|
221 | 221 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
|
222 | 222 | f mammals/skunk skunk |
|
223 | 223 | $ hg debugwalk Procyonidae |
|
224 |
matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))' |
|
|
224 | matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))'> | |
|
225 | 225 | f mammals/Procyonidae/cacomistle Procyonidae/cacomistle |
|
226 | 226 | f mammals/Procyonidae/coatimundi Procyonidae/coatimundi |
|
227 | 227 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
|
228 | 228 | |
|
229 | 229 | $ cd Procyonidae |
|
230 | 230 | $ hg debugwalk . |
|
231 |
matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))' |
|
|
231 | matcher: <patternmatcher patterns='(?:mammals\\/Procyonidae(?:/|$))'> | |
|
232 | 232 | f mammals/Procyonidae/cacomistle cacomistle |
|
233 | 233 | f mammals/Procyonidae/coatimundi coatimundi |
|
234 | 234 | f mammals/Procyonidae/raccoon raccoon |
|
235 | 235 | $ hg debugwalk .. |
|
236 |
matcher: <patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
236 | matcher: <patternmatcher patterns='(?:mammals(?:/|$))'> | |
|
237 | 237 | f mammals/Procyonidae/cacomistle cacomistle |
|
238 | 238 | f mammals/Procyonidae/coatimundi coatimundi |
|
239 | 239 | f mammals/Procyonidae/raccoon raccoon |
@@ -241,7 +241,7 b'' | |||
|
241 | 241 | $ cd .. |
|
242 | 242 | |
|
243 | 243 | $ hg debugwalk ../beans |
|
244 |
matcher: <patternmatcher patterns='(?:beans(?:/|$))' |
|
|
244 | matcher: <patternmatcher patterns='(?:beans(?:/|$))'> | |
|
245 | 245 | f beans/black ../beans/black |
|
246 | 246 | f beans/borlotti ../beans/borlotti |
|
247 | 247 | f beans/kidney ../beans/kidney |
@@ -249,7 +249,7 b'' | |||
|
249 | 249 | f beans/pinto ../beans/pinto |
|
250 | 250 | f beans/turtle ../beans/turtle |
|
251 | 251 | $ hg debugwalk . |
|
252 |
matcher: <patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
252 | matcher: <patternmatcher patterns='(?:mammals(?:/|$))'> | |
|
253 | 253 | f mammals/Procyonidae/cacomistle Procyonidae/cacomistle |
|
254 | 254 | f mammals/Procyonidae/coatimundi Procyonidae/coatimundi |
|
255 | 255 | f mammals/Procyonidae/raccoon Procyonidae/raccoon |
@@ -276,20 +276,20 b'' | |||
|
276 | 276 | f fenugreek fenugreek |
|
277 | 277 | f mammals/skunk mammals/skunk |
|
278 | 278 | $ hg debugwalk -Ibeans mammals |
|
279 |
matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
279 | matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>> | |
|
280 | 280 | $ hg debugwalk -Inon-existent |
|
281 | 281 | matcher: <includematcher includes='(?:non\\-existent(?:/|$))'> |
|
282 | 282 | $ hg debugwalk -Inon-existent -Ibeans/black |
|
283 | 283 | matcher: <includematcher includes='(?:non\\-existent(?:/|$)|beans\\/black(?:/|$))'> |
|
284 | 284 | f beans/black beans/black |
|
285 | 285 | $ hg debugwalk -Ibeans beans/black |
|
286 |
matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))' |
|
|
286 | matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>> | |
|
287 | 287 | f beans/black beans/black exact |
|
288 | 288 | $ hg debugwalk -Ibeans/black beans |
|
289 |
matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans(?:/|$))' |
|
|
289 | matcher: <intersectionmatcher m1=<patternmatcher patterns='(?:beans(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>> | |
|
290 | 290 | f beans/black beans/black |
|
291 | 291 | $ hg debugwalk -Xbeans/black beans |
|
292 |
matcher: <differencematcher m1=<patternmatcher patterns='(?:beans(?:/|$))' |
|
|
292 | matcher: <differencematcher m1=<patternmatcher patterns='(?:beans(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>> | |
|
293 | 293 | f beans/borlotti beans/borlotti |
|
294 | 294 | f beans/kidney beans/kidney |
|
295 | 295 | f beans/navy beans/navy |
@@ -303,24 +303,24 b'' | |||
|
303 | 303 | f beans/pinto beans/pinto |
|
304 | 304 | f beans/turtle beans/turtle |
|
305 | 305 | $ hg debugwalk -Xbeans/black beans/black |
|
306 |
matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))' |
|
|
306 | matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>> | |
|
307 | 307 | f beans/black beans/black exact |
|
308 | 308 | $ hg debugwalk -Xbeans/black -Ibeans/black |
|
309 | 309 | matcher: <differencematcher m1=<includematcher includes='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans\\/black(?:/|$))'>> |
|
310 | 310 | $ hg debugwalk -Xbeans beans/black |
|
311 |
matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))' |
|
|
311 | matcher: <differencematcher m1=<patternmatcher patterns='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>> | |
|
312 | 312 | f beans/black beans/black exact |
|
313 | 313 | $ hg debugwalk -Xbeans -Ibeans/black |
|
314 | 314 | matcher: <differencematcher m1=<includematcher includes='(?:beans\\/black(?:/|$))'>, m2=<includematcher includes='(?:beans(?:/|$))'>> |
|
315 | 315 | $ hg debugwalk 'glob:mammals/../beans/b*' |
|
316 |
matcher: <patternmatcher patterns='(?:beans\\/b[^/]*$)' |
|
|
316 | matcher: <patternmatcher patterns='(?:beans\\/b[^/]*$)'> | |
|
317 | 317 | f beans/black beans/black |
|
318 | 318 | f beans/borlotti beans/borlotti |
|
319 | 319 | $ hg debugwalk '-X*/Procyonidae' mammals |
|
320 |
matcher: <differencematcher m1=<patternmatcher patterns='(?:mammals(?:/|$))' |
|
|
320 | matcher: <differencematcher m1=<patternmatcher patterns='(?:mammals(?:/|$))'>, m2=<includematcher includes='(?:[^/]*\\/Procyonidae(?:/|$))'>> | |
|
321 | 321 | f mammals/skunk mammals/skunk |
|
322 | 322 | $ hg debugwalk path:mammals |
|
323 |
matcher: <patternmatcher patterns='(?:^mammals(?:/|$))' |
|
|
323 | matcher: <patternmatcher patterns='(?:^mammals(?:/|$))'> | |
|
324 | 324 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
325 | 325 | f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi |
|
326 | 326 | f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon |
@@ -347,7 +347,7 b'' | |||
|
347 | 347 | Test absolute paths: |
|
348 | 348 | |
|
349 | 349 | $ hg debugwalk `pwd`/beans |
|
350 |
matcher: <patternmatcher patterns='(?:beans(?:/|$))' |
|
|
350 | matcher: <patternmatcher patterns='(?:beans(?:/|$))'> | |
|
351 | 351 | f beans/black beans/black |
|
352 | 352 | f beans/borlotti beans/borlotti |
|
353 | 353 | f beans/kidney beans/kidney |
@@ -361,7 +361,7 b' Test absolute paths:' | |||
|
361 | 361 | Test patterns: |
|
362 | 362 | |
|
363 | 363 | $ hg debugwalk glob:\* |
|
364 |
matcher: <patternmatcher patterns='(?:[^/]*$)' |
|
|
364 | matcher: <patternmatcher patterns='(?:[^/]*$)'> | |
|
365 | 365 | f fennel fennel |
|
366 | 366 | f fenugreek fenugreek |
|
367 | 367 | f fiddlehead fiddlehead |
@@ -371,19 +371,19 b' Test patterns:' | |||
|
371 | 371 | adding glob:glob |
|
372 | 372 | warning: filename contains ':', which is reserved on Windows: 'glob:glob' |
|
373 | 373 | $ hg debugwalk glob:\* |
|
374 |
matcher: <patternmatcher patterns='(?:[^/]*$)' |
|
|
374 | matcher: <patternmatcher patterns='(?:[^/]*$)'> | |
|
375 | 375 | f fennel fennel |
|
376 | 376 | f fenugreek fenugreek |
|
377 | 377 | f fiddlehead fiddlehead |
|
378 | 378 | f glob:glob glob:glob |
|
379 | 379 | $ hg debugwalk glob:glob |
|
380 |
matcher: <patternmatcher patterns='(?:glob$)' |
|
|
380 | matcher: <patternmatcher patterns='(?:glob$)'> | |
|
381 | 381 | glob: No such file or directory |
|
382 | 382 | $ hg debugwalk glob:glob:glob |
|
383 |
matcher: <patternmatcher patterns='(?:glob\\:glob$)' |
|
|
383 | matcher: <patternmatcher patterns='(?:glob\\:glob$)'> | |
|
384 | 384 | f glob:glob glob:glob exact |
|
385 | 385 | $ hg debugwalk path:glob:glob |
|
386 |
matcher: <patternmatcher patterns='(?:^glob\\:glob(?:/|$))' |
|
|
386 | matcher: <patternmatcher patterns='(?:^glob\\:glob(?:/|$))'> | |
|
387 | 387 | f glob:glob glob:glob exact |
|
388 | 388 | $ rm glob:glob |
|
389 | 389 | $ hg addremove |
@@ -391,38 +391,38 b' Test patterns:' | |||
|
391 | 391 | #endif |
|
392 | 392 | |
|
393 | 393 | $ hg debugwalk 'glob:**e' |
|
394 |
matcher: <patternmatcher patterns='(?:.*e$)' |
|
|
394 | matcher: <patternmatcher patterns='(?:.*e$)'> | |
|
395 | 395 | f beans/turtle beans/turtle |
|
396 | 396 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
397 | 397 | |
|
398 | 398 | $ hg debugwalk 're:.*[kb]$' |
|
399 |
matcher: <patternmatcher patterns='(?:.*[kb]$)' |
|
|
399 | matcher: <patternmatcher patterns='(?:.*[kb]$)'> | |
|
400 | 400 | f beans/black beans/black |
|
401 | 401 | f fenugreek fenugreek |
|
402 | 402 | f mammals/skunk mammals/skunk |
|
403 | 403 | |
|
404 | 404 | $ hg debugwalk path:beans/black |
|
405 |
matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))' |
|
|
405 | matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))'> | |
|
406 | 406 | f beans/black beans/black exact |
|
407 | 407 | $ hg debugwalk path:beans//black |
|
408 |
matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))' |
|
|
408 | matcher: <patternmatcher patterns='(?:^beans\\/black(?:/|$))'> | |
|
409 | 409 | f beans/black beans/black exact |
|
410 | 410 | |
|
411 | 411 | $ hg debugwalk relglob:Procyonidae |
|
412 |
matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae$)' |
|
|
412 | matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae$)'> | |
|
413 | 413 | $ hg debugwalk 'relglob:Procyonidae/**' |
|
414 |
matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$)' |
|
|
414 | matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$)'> | |
|
415 | 415 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
416 | 416 | f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi |
|
417 | 417 | f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon |
|
418 | 418 | $ hg debugwalk 'relglob:Procyonidae/**' fennel |
|
419 |
matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$|fennel(?:/|$))' |
|
|
419 | matcher: <patternmatcher patterns='(?:(?:|.*/)Procyonidae\\/.*$|fennel(?:/|$))'> | |
|
420 | 420 | f fennel fennel exact |
|
421 | 421 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
422 | 422 | f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi |
|
423 | 423 | f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon |
|
424 | 424 | $ hg debugwalk beans 'glob:beans/*' |
|
425 |
matcher: <patternmatcher patterns='(?:beans(?:/|$)|beans\\/[^/]*$)' |
|
|
425 | matcher: <patternmatcher patterns='(?:beans(?:/|$)|beans\\/[^/]*$)'> | |
|
426 | 426 | f beans/black beans/black |
|
427 | 427 | f beans/borlotti beans/borlotti |
|
428 | 428 | f beans/kidney beans/kidney |
@@ -430,51 +430,51 b' Test patterns:' | |||
|
430 | 430 | f beans/pinto beans/pinto |
|
431 | 431 | f beans/turtle beans/turtle |
|
432 | 432 | $ hg debugwalk 'glob:mamm**' |
|
433 |
matcher: <patternmatcher patterns='(?:mamm.*$)' |
|
|
433 | matcher: <patternmatcher patterns='(?:mamm.*$)'> | |
|
434 | 434 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
435 | 435 | f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi |
|
436 | 436 | f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon |
|
437 | 437 | f mammals/skunk mammals/skunk |
|
438 | 438 | $ hg debugwalk 'glob:mamm**' fennel |
|
439 |
matcher: <patternmatcher patterns='(?:mamm.*$|fennel(?:/|$))' |
|
|
439 | matcher: <patternmatcher patterns='(?:mamm.*$|fennel(?:/|$))'> | |
|
440 | 440 | f fennel fennel exact |
|
441 | 441 | f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle |
|
442 | 442 | f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi |
|
443 | 443 | f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon |
|
444 | 444 | f mammals/skunk mammals/skunk |
|
445 | 445 | $ hg debugwalk 'glob:j*' |
|
446 |
matcher: <patternmatcher patterns='(?:j[^/]*$)' |
|
|
446 | matcher: <patternmatcher patterns='(?:j[^/]*$)'> | |
|
447 | 447 | $ hg debugwalk NOEXIST |
|
448 |
matcher: <patternmatcher patterns='(?:NOEXIST(?:/|$))' |
|
|
448 | matcher: <patternmatcher patterns='(?:NOEXIST(?:/|$))'> | |
|
449 | 449 | NOEXIST: * (glob) |
|
450 | 450 | |
|
451 | 451 | #if fifo |
|
452 | 452 | $ mkfifo fifo |
|
453 | 453 | $ hg debugwalk fifo |
|
454 |
matcher: <patternmatcher patterns='(?:fifo(?:/|$))' |
|
|
454 | matcher: <patternmatcher patterns='(?:fifo(?:/|$))'> | |
|
455 | 455 | fifo: unsupported file type (type is fifo) |
|
456 | 456 | #endif |
|
457 | 457 | |
|
458 | 458 | $ rm fenugreek |
|
459 | 459 | $ hg debugwalk fenugreek |
|
460 |
matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))' |
|
|
460 | matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))'> | |
|
461 | 461 | f fenugreek fenugreek exact |
|
462 | 462 | $ hg rm fenugreek |
|
463 | 463 | $ hg debugwalk fenugreek |
|
464 |
matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))' |
|
|
464 | matcher: <patternmatcher patterns='(?:fenugreek(?:/|$))'> | |
|
465 | 465 | f fenugreek fenugreek exact |
|
466 | 466 | $ touch new |
|
467 | 467 | $ hg debugwalk new |
|
468 |
matcher: <patternmatcher patterns='(?:new(?:/|$))' |
|
|
468 | matcher: <patternmatcher patterns='(?:new(?:/|$))'> | |
|
469 | 469 | f new new exact |
|
470 | 470 | |
|
471 | 471 | $ mkdir ignored |
|
472 | 472 | $ touch ignored/file |
|
473 | 473 | $ echo '^ignored$' > .hgignore |
|
474 | 474 | $ hg debugwalk ignored |
|
475 |
matcher: <patternmatcher patterns='(?:ignored(?:/|$))' |
|
|
475 | matcher: <patternmatcher patterns='(?:ignored(?:/|$))'> | |
|
476 | 476 | $ hg debugwalk ignored/file |
|
477 |
matcher: <patternmatcher patterns='(?:ignored\\/file(?:/|$))' |
|
|
477 | matcher: <patternmatcher patterns='(?:ignored\\/file(?:/|$))'> | |
|
478 | 478 | f ignored/file ignored/file exact |
|
479 | 479 | |
|
480 | 480 | Test listfile and listfile0 |
@@ -493,15 +493,15 b' Test listfile and listfile0' | |||
|
493 | 493 | |
|
494 | 494 | $ cd .. |
|
495 | 495 | $ hg debugwalk -R t t/mammals/skunk |
|
496 |
matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))' |
|
|
496 | matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'> | |
|
497 | 497 | f mammals/skunk t/mammals/skunk exact |
|
498 | 498 | $ mkdir t2 |
|
499 | 499 | $ cd t2 |
|
500 | 500 | $ hg debugwalk -R ../t ../t/mammals/skunk |
|
501 |
matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))' |
|
|
501 | matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'> | |
|
502 | 502 | f mammals/skunk ../t/mammals/skunk exact |
|
503 | 503 | $ hg debugwalk --cwd ../t mammals/skunk |
|
504 |
matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))' |
|
|
504 | matcher: <patternmatcher patterns='(?:mammals\\/skunk(?:/|$))'> | |
|
505 | 505 | f mammals/skunk mammals/skunk exact |
|
506 | 506 | |
|
507 | 507 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now