# HG changeset patch # User Matt Mackall # Date 1243151774 18000 # Node ID 4fadac10181830afe061a92b99c7845c88f94281 # Parent 4fa1618bf49513ca2e4c31280c3320d96e371636 util: privatize globre diff -r 4fa1618bf495 -r 4fadac101818 mercurial/util.py --- a/mercurial/util.py Sun May 24 02:56:14 2009 -0500 +++ b/mercurial/util.py Sun May 24 02:56:14 2009 -0500 @@ -214,7 +214,7 @@ if pat.startswith(prefix + ':'): return pat.split(':', 1) return default, pat -def globre(pat, head='^', tail='$'): +def _globre(pat, head='^', tail='$'): "convert a glob pattern into a regexp" i, n = 0, len(pat) res = '' @@ -389,14 +389,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 matchfn(pats, tail): """build a matching function from a set of patterns"""