diff mercurial/match.py @ 8572:dd46948a07fa

match: kill test in matchfn
author Matt Mackall <mpm@selenic.com>
date Sun, 24 May 2009 02:56:14 -0500
parents 9f12e1a27a1b
children 62c996d543e6
line wrap: on
line diff
--- a/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
+++ b/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
@@ -175,8 +175,6 @@
 
     def matchfn(pats, tail):
         """build a matching function from a set of patterns"""
-        if not pats:
-            return
         try:
             pat = '(?:%s)' % '|'.join([regex(k, p, tail) for (k, p) in pats])
             if len(pat) > 20000:
@@ -233,7 +231,8 @@
 
     roots, pats, anypats = normalizepats(names, dflt_pat)
 
-    patmatch = matchfn(pats, '$')
+    if names:
+        patmatch = matchfn(pats, '$')
     if inc:
         dummy, inckinds, dummy = normalizepats(inc, 'glob')
         incmatch = matchfn(inckinds, '(?:/|$)')