##// END OF EJS Templates
util.*matcher: change default "names" argument...
Alexis S. L. Carvalho -
r4190:769bc4af default
parent child Browse files
Show More
@@ -378,10 +378,10 b' def canonpath(root, cwd, myname):'
378 378
379 379 raise Abort('%s not under root' % myname)
380 380
381 def matcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head='', src=None):
381 def matcher(canonroot, cwd='', names=[], inc=[], exc=[], head='', src=None):
382 382 return _matcher(canonroot, cwd, names, inc, exc, head, 'glob', src)
383 383
384 def cmdmatcher(canonroot, cwd='', names=['.'], inc=[], exc=[], head='',
384 def cmdmatcher(canonroot, cwd='', names=[], inc=[], exc=[], head='',
385 385 src=None, globbed=False):
386 386 if not globbed:
387 387 names = expand_glob(names)
@@ -428,6 +428,8 b' def _matcher(canonroot, cwd, names, inc,'
428 428
429 429 def regex(kind, name, tail):
430 430 '''convert a pattern into a regular expression'''
431 if not name:
432 return ''
431 433 if kind == 're':
432 434 return name
433 435 elif kind == 'path':
@@ -477,8 +479,6 b' def _matcher(canonroot, cwd, names, inc,'
477 479 for kind, name in [patkind(p, dflt_pat) for p in names]:
478 480 if kind in ('glob', 'relpath'):
479 481 name = canonpath(canonroot, cwd, name)
480 if name == '':
481 kind, name = 'glob', '**'
482 482 elif kind in ('relglob', 'path'):
483 483 name = normpath(name)
484 484 if kind in ('glob', 're', 'relglob'):
@@ -509,7 +509,7 b' def _matcher(canonroot, cwd, names, inc,'
509 509 (not pats and not files) or
510 510 (pats and patmatch(fn)) or
511 511 (files and filematch(fn)))),
512 (inc or exc or (pats and pats != [('glob', '**')])) and True)
512 (inc or exc or pats) and True)
513 513
514 514 def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None):
515 515 '''enhanced shell command execution.
@@ -19,8 +19,10 b' echo glob:glob > glob:glob'
19 19 hg addremove
20 20 hg commit -m "commit #0" -d "1000000 0"
21 21 hg debugwalk
22 hg debugwalk -I.
22 23 cd mammals
23 24 hg debugwalk .
25 hg debugwalk -I.
24 26 hg debugwalk Procyonidae
25 27 cd Procyonidae
26 28 hg debugwalk .
@@ -26,6 +26,24 b' f mammals/Procyonidae/cacomistle mamma'
26 26 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
27 27 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
28 28 f mammals/skunk mammals/skunk
29 f beans/black beans/black
30 f beans/borlotti beans/borlotti
31 f beans/kidney beans/kidney
32 f beans/navy beans/navy
33 f beans/pinto beans/pinto
34 f beans/turtle beans/turtle
35 f fennel fennel
36 f fenugreek fenugreek
37 f fiddlehead fiddlehead
38 f glob:glob glob:glob
39 f mammals/Procyonidae/cacomistle mammals/Procyonidae/cacomistle
40 f mammals/Procyonidae/coatimundi mammals/Procyonidae/coatimundi
41 f mammals/Procyonidae/raccoon mammals/Procyonidae/raccoon
42 f mammals/skunk mammals/skunk
43 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
44 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
45 f mammals/Procyonidae/raccoon Procyonidae/raccoon
46 f mammals/skunk skunk
29 47 f mammals/Procyonidae/cacomistle Procyonidae/cacomistle
30 48 f mammals/Procyonidae/coatimundi Procyonidae/coatimundi
31 49 f mammals/Procyonidae/raccoon Procyonidae/raccoon
General Comments 0
You need to be logged in to leave comments. Login now