mercurial/match.py
changeset 10282 08a0f04b56bd
parent 10263 25e572394f5c
child 12133 b046b90c4ae5
equal deleted inserted replaced
10281:e7d3b509af8b 10282:08a0f04b56bd
   123     "convert a glob pattern into a regexp"
   123     "convert a glob pattern into a regexp"
   124     i, n = 0, len(pat)
   124     i, n = 0, len(pat)
   125     res = ''
   125     res = ''
   126     group = 0
   126     group = 0
   127     escape = re.escape
   127     escape = re.escape
   128     def peek(): return i < n and pat[i]
   128     def peek():
       
   129         return i < n and pat[i]
   129     while i < n:
   130     while i < n:
   130         c = pat[i]
   131         c = pat[i]
   131         i = i+1
   132         i += 1
   132         if c not in '*?[{},\\':
   133         if c not in '*?[{},\\':
   133             res += escape(c)
   134             res += escape(c)
   134         elif c == '*':
   135         elif c == '*':
   135             if peek() == '*':
   136             if peek() == '*':
   136                 i += 1
   137                 i += 1