mercurial/match.py
changeset 38578 2d487b9cac07
parent 38577 76838305b9dd
child 38579 ec0cee4c1fff
equal deleted inserted replaced
38577:76838305b9dd 38578:2d487b9cac07
   817         return '(?:|.*/)' + _globre(pat) + globsuffix
   817         return '(?:|.*/)' + _globre(pat) + globsuffix
   818     if kind == 'relre':
   818     if kind == 'relre':
   819         if pat.startswith('^'):
   819         if pat.startswith('^'):
   820             return pat
   820             return pat
   821         return '.*' + pat
   821         return '.*' + pat
   822     return _globre(pat) + globsuffix
   822     if kind == 'glob':
       
   823         return _globre(pat) + globsuffix
       
   824     raise error.ProgrammingError('not a regex pattern: %s:%s' % (kind, pat))
   823 
   825 
   824 def _buildmatch(ctx, kindpats, globsuffix, listsubrepos, root):
   826 def _buildmatch(ctx, kindpats, globsuffix, listsubrepos, root):
   825     '''Return regexp string and a matcher function for kindpats.
   827     '''Return regexp string and a matcher function for kindpats.
   826     globsuffix is appended to the regexp of globs.'''
   828     globsuffix is appended to the regexp of globs.'''
   827     matchfuncs = []
   829     matchfuncs = []