changeset 8580:f648c096f6d0

match: rename _matchfn to _buildmatch
author Matt Mackall <mpm@selenic.com>
date Sun, 24 May 2009 02:56:14 -0500
parents aff7f83c365b
children 101d305c1d0b
files mercurial/match.py
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
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
@@ -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: