comparison mercurial/util.py @ 4194:ec932167c3a7

Optimize return value of util._matcher for hgignore case
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 10 Mar 2007 23:01:02 -0300
parents 9e3121017fb2
children b5d1eaade333 03a665f9f913
comparison
equal deleted inserted replaced
4193:9e3121017fb2 4194:ec932167c3a7
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