# HG changeset patch # User Benoit Boissinot # Date 1143153593 -3600 # Node ID 4b0535c678d6a71ea992e079c3d473aafdfdcaaf # Parent 719cf07b076de55c3c8a0262154adb392f48f1ab make it possible to escape characters in a glob expression diff --git a/mercurial/util.py b/mercurial/util.py --- a/mercurial/util.py +++ b/mercurial/util.py @@ -155,6 +155,13 @@ def globre(pat, head='^', tail='$'): group = False elif c == ',' and group: res += '|' + elif c == '\\': + p = peek() + if p: + i += 1 + res += re.escape(p) + else: + res += re.escape(c) else: res += re.escape(c) return head + res + tail