Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 5949:48d01b1e315f
Permit glob patterns to use nested curly braces.
author | Jesse Glick <jesse.glick@sun.com> |
---|---|
date | Fri, 25 Jan 2008 15:54:25 -0500 |
parents | 549a7ebe1607 |
children | 75d9fe70c654 |
line wrap: on
line diff
--- a/mercurial/util.py Sat Jan 26 00:14:20 2008 +0100 +++ b/mercurial/util.py Fri Jan 25 15:54:25 2008 -0500 @@ -262,7 +262,7 @@ "convert a glob pattern into a regexp" i, n = 0, len(pat) res = '' - group = False + group = 0 def peek(): return i < n and pat[i] while i < n: c = pat[i] @@ -292,11 +292,11 @@ stuff = '\\' + stuff res = '%s[%s]' % (res, stuff) elif c == '{': - group = True + group += 1 res += '(?:' elif c == '}' and group: res += ')' - group = False + group -= 1 elif c == ',' and group: res += '|' elif c == '\\':