Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/util.py @ 1990:4b0535c678d6
make it possible to escape characters in a glob expression
author | Benoit Boissinot <benoit.boissinot@ens-lyon.org> |
---|---|
date | Thu, 23 Mar 2006 23:39:53 +0100 |
parents | df8416346bb7 |
children | a8a618c57690 |
comparison
equal
deleted
inserted
replaced
1986:719cf07b076d | 1990:4b0535c678d6 |
---|---|
153 elif c == '}' and group: | 153 elif c == '}' and group: |
154 res += ')' | 154 res += ')' |
155 group = False | 155 group = False |
156 elif c == ',' and group: | 156 elif c == ',' and group: |
157 res += '|' | 157 res += '|' |
158 elif c == '\\': | |
159 p = peek() | |
160 if p: | |
161 i += 1 | |
162 res += re.escape(p) | |
163 else: | |
164 res += re.escape(c) | |
158 else: | 165 else: |
159 res += re.escape(c) | 166 res += re.escape(c) |
160 return head + res + tail | 167 return head + res + tail |
161 | 168 |
162 _globchars = {'[': 1, '{': 1, '*': 1, '?': 1} | 169 _globchars = {'[': 1, '{': 1, '*': 1, '?': 1} |