match: rename _matchfn to _buildmatch
authorMatt Mackall <mpm@selenic.com>
Sun, 24 May 2009 02:56:14 -0500
changeset 8580 f648c096f6d0
parent 8579 aff7f83c365b
child 8581 101d305c1d0b
match: rename _matchfn to _buildmatch
mercurial/match.py
--- a/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
+++ b/mercurial/match.py	Sun May 24 02:56:14 2009 -0500
@@ -135,7 +135,7 @@
         return '.*' + name
     return _globre(name, '', tail)
 
-def _matchfn(pats, tail):
+def _buildmatch(pats, tail):
     """build a matching function from a set of patterns"""
     try:
         pat = '(?:%s)' % '|'.join([_regex(k, p, tail) for (k, p) in pats])
@@ -149,7 +149,7 @@
         l = len(pats)
         if l < 2:
             raise
-        a, b = _matchfn(pats[:l//2], tail), matchfn(pats[l//2:], tail)
+        a, b = _buildmatch(pats[:l//2], tail), _buildmatch(pats[l//2:], tail)
         return lambda s: a(s) or b(s)
     except re.error:
         for k, p in pats:
@@ -231,11 +231,11 @@
         pats = _normalize(names, dflt_pat, root, cwd)
         roots = _roots(pats)
         anypats = anypats or _anypats(pats)
-        patmatch = _matchfn(pats, '$')
+        patmatch = _buildmatch(pats, '$')
     if inc:
-        incmatch = _matchfn(_normalize(inc, 'glob', root, cwd), '(?:/|$)')
+        incmatch = _buildmatch(_normalize(inc, 'glob', root, cwd), '(?:/|$)')
     if exc:
-        excmatch = _matchfn(_normalize(exc, 'glob', root, cwd), '(?:/|$)')
+        excmatch = _buildmatch(_normalize(exc, 'glob', root, cwd), '(?:/|$)')
 
     if names:
         if inc: