507 excmatch = lambda fn: False |
507 excmatch = lambda fn: False |
508 if exc: |
508 if exc: |
509 dummy, exckinds, dummy = normalizepats(exc, 'glob') |
509 dummy, exckinds, dummy = normalizepats(exc, 'glob') |
510 excmatch = matchfn(exckinds, '(?:/|$)') |
510 excmatch = matchfn(exckinds, '(?:/|$)') |
511 |
511 |
512 return (roots, |
512 if not names and inc and not exc: |
513 lambda fn: (incmatch(fn) and not excmatch(fn) and patmatch(fn)), |
513 # common case: hgignore patterns |
514 (inc or exc or anypats) and True) |
514 match = incmatch |
|
515 else: |
|
516 match = lambda fn: incmatch(fn) and not excmatch(fn) and patmatch(fn) |
|
517 |
|
518 return (roots, match, (inc or exc or anypats) and True) |
515 |
519 |
516 def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): |
520 def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): |
517 '''enhanced shell command execution. |
521 '''enhanced shell command execution. |
518 run with environment maybe modified, maybe in different dir. |
522 run with environment maybe modified, maybe in different dir. |
519 |
523 |