--- a/mercurial/match.py Sun May 24 02:56:14 2009 -0500
+++ b/mercurial/match.py Sun May 24 02:56:14 2009 -0500
@@ -120,7 +120,7 @@
return pat, val
return default, pat
-def _globre(pat, head, tail):
+def _globre(pat):
"convert a glob pattern into a regexp"
i, n = 0, len(pat)
res = ''
@@ -170,7 +170,7 @@
res += re.escape(c)
else:
res += re.escape(c)
- return head + res + tail
+ return res
def _regex(kind, name, tail):
'''convert a pattern into a regular expression'''
@@ -181,14 +181,14 @@
elif kind == 'path':
return '^' + re.escape(name) + '(?:/|$)'
elif kind == 'relglob':
- return _globre(name, '(?:|.*/)', tail)
+ return '(?:|.*/)' + _globre(name) + tail
elif kind == 'relpath':
return re.escape(name) + '(?:/|$)'
elif kind == 'relre':
if name.startswith('^'):
return name
return '.*' + name
- return _globre(name, '', tail)
+ return _globre(name) + tail
def _buildmatch(pats, tail):
"""build a matching function from a set of patterns"""