Mercurial > hg > mercurial-crew-with-dirclash
changeset 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 |
files | mercurial/util.py |
diffstat | 1 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/mercurial/util.py +++ b/mercurial/util.py @@ -509,9 +509,13 @@ def _matcher(canonroot, cwd, names, inc, dummy, exckinds, dummy = normalizepats(exc, 'glob') excmatch = matchfn(exckinds, '(?:/|$)') - return (roots, - lambda fn: (incmatch(fn) and not excmatch(fn) and patmatch(fn)), - (inc or exc or anypats) and True) + if not names and inc and not exc: + # common case: hgignore patterns + match = incmatch + else: + match = lambda fn: incmatch(fn) and not excmatch(fn) and patmatch(fn) + + return (roots, match, (inc or exc or anypats) and True) def system(cmd, environ={}, cwd=None, onerr=None, errprefix=None): '''enhanced shell command execution.