Show More
@@ -129,8 +129,9 b' class match(object):' | |||||
129 | kindpats = self._normalize(exclude, 'glob', root, cwd, auditor) |
|
129 | kindpats = self._normalize(exclude, 'glob', root, cwd, auditor) | |
130 | self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)', |
|
130 | self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)', | |
131 | listsubrepos, root) |
|
131 | listsubrepos, root) | |
132 |
|
|
132 | if not _anypats(kindpats): | |
133 |
self._excluderoots. |
|
133 | self._excluderoots.update(_roots(kindpats)) | |
|
134 | self._excluderoots.discard('.') | |||
134 | matchfns.append(lambda f: not em(f)) |
|
135 | matchfns.append(lambda f: not em(f)) | |
135 | if exact: |
|
136 | if exact: | |
136 | if isinstance(patterns, list): |
|
137 | if isinstance(patterns, list): |
@@ -322,6 +322,13 b' Test files from the root.' | |||||
322 | c.txt |
|
322 | c.txt | |
323 | d.py |
|
323 | d.py | |
324 |
|
324 | |||
|
325 | Excludes with a glob should not exclude everything from the glob's root | |||
|
326 | ||||
|
327 | $ hg files -r . -X 'b/fo?' b | |||
|
328 | b/bar/fruits.txt | |||
|
329 | b/bar/orange/fly/gnat.py | |||
|
330 | b/bar/orange/fly/housefly.txt | |||
|
331 | ||||
325 | Test files for a subdirectory. |
|
332 | Test files for a subdirectory. | |
326 |
|
333 | |||
327 | $ mv .hg/store/meta/a oldmf |
|
334 | $ mv .hg/store/meta/a oldmf | |
@@ -337,7 +344,7 b' Test files with just includes and exclud' | |||||
337 | $ mv .hg/store/meta/a oldmf |
|
344 | $ mv .hg/store/meta/a oldmf | |
338 | $ mv .hg/store/meta/b/bar/orange/fly oldmf2 |
|
345 | $ mv .hg/store/meta/b/bar/orange/fly oldmf2 | |
339 | $ mv .hg/store/meta/b/foo/apple/bees oldmf3 |
|
346 | $ mv .hg/store/meta/b/foo/apple/bees oldmf3 | |
340 | $ hg files -r . -I b/bar -X b/bar/orange/fly -I b/foo -X b/foo/apple/bees |
|
347 | $ hg files -r . -I path:b/bar -X path:b/bar/orange/fly -I path:b/foo -X path:b/foo/apple/bees | |
341 | b/bar/fruits.txt (glob) |
|
348 | b/bar/fruits.txt (glob) | |
342 | $ mv oldmf .hg/store/meta/a |
|
349 | $ mv oldmf .hg/store/meta/a | |
343 | $ mv oldmf2 .hg/store/meta/b/bar/orange/fly |
|
350 | $ mv oldmf2 .hg/store/meta/b/bar/orange/fly | |
@@ -347,7 +354,7 b' Test files for a subdirectory, excluding' | |||||
347 |
|
354 | |||
348 | $ mv .hg/store/meta/a oldmf |
|
355 | $ mv .hg/store/meta/a oldmf | |
349 | $ mv .hg/store/meta/b/foo oldmf2 |
|
356 | $ mv .hg/store/meta/b/foo oldmf2 | |
350 | $ hg files -r . -X b/foo b |
|
357 | $ hg files -r . -X path:b/foo b | |
351 | b/bar/fruits.txt (glob) |
|
358 | b/bar/fruits.txt (glob) | |
352 | b/bar/orange/fly/gnat.py (glob) |
|
359 | b/bar/orange/fly/gnat.py (glob) | |
353 | b/bar/orange/fly/housefly.txt (glob) |
|
360 | b/bar/orange/fly/housefly.txt (glob) | |
@@ -359,7 +366,7 b' including an unrelated directory.' | |||||
359 |
|
366 | |||
360 | $ mv .hg/store/meta/a oldmf |
|
367 | $ mv .hg/store/meta/a oldmf | |
361 | $ mv .hg/store/meta/b/foo oldmf2 |
|
368 | $ mv .hg/store/meta/b/foo oldmf2 | |
362 | $ hg files -r . -I b/bar/orange -I a b |
|
369 | $ hg files -r . -I path:b/bar/orange -I path:a b | |
363 | b/bar/orange/fly/gnat.py (glob) |
|
370 | b/bar/orange/fly/gnat.py (glob) | |
364 | b/bar/orange/fly/housefly.txt (glob) |
|
371 | b/bar/orange/fly/housefly.txt (glob) | |
365 | $ mv oldmf .hg/store/meta/a |
|
372 | $ mv oldmf .hg/store/meta/a | |
@@ -371,7 +378,7 b' within that.' | |||||
371 | $ mv .hg/store/meta/a oldmf |
|
378 | $ mv .hg/store/meta/a oldmf | |
372 | $ mv .hg/store/meta/b/foo oldmf2 |
|
379 | $ mv .hg/store/meta/b/foo oldmf2 | |
373 | $ mv .hg/store/meta/b/bar/orange oldmf3 |
|
380 | $ mv .hg/store/meta/b/bar/orange oldmf3 | |
374 | $ hg files -r . glob:**.txt -I b/bar -X b/bar/orange |
|
381 | $ hg files -r . glob:**.txt -I path:b/bar -X path:b/bar/orange | |
375 | b/bar/fruits.txt (glob) |
|
382 | b/bar/fruits.txt (glob) | |
376 | $ mv oldmf .hg/store/meta/a |
|
383 | $ mv oldmf .hg/store/meta/a | |
377 | $ mv oldmf2 .hg/store/meta/b/foo |
|
384 | $ mv oldmf2 .hg/store/meta/b/foo |
General Comments 0
You need to be logged in to leave comments.
Login now