diff --git a/mercurial/match.py b/mercurial/match.py --- a/mercurial/match.py +++ b/mercurial/match.py @@ -247,7 +247,7 @@ def _globre(pat): i, n = 0, len(pat) res = '' group = 0 - escape = re.escape + escape = util.re.escape def peek(): return i < n and pat[i] while i < n: @@ -310,11 +310,11 @@ def _regex(kind, pat, globsuffix): if kind == 're': return pat if kind == 'path': - return '^' + re.escape(pat) + '(?:/|$)' + return '^' + util.re.escape(pat) + '(?:/|$)' if kind == 'relglob': return '(?:|.*/)' + _globre(pat) + globsuffix if kind == 'relpath': - return re.escape(pat) + '(?:/|$)' + return util.re.escape(pat) + '(?:/|$)' if kind == 'relre': if pat.startswith('^'): return pat