--- a/mercurial/util.py Sat Mar 10 23:01:00 2007 -0300
+++ b/mercurial/util.py Sat Mar 10 23:01:02 2007 -0300
@@ -509,9 +509,13 @@
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.