comparison mercurial/util.py @ 4304:702f48570eb3

change relglob: patterns to be consistent with glob: patterns With this change, you have to use "hg locate 'hgweb/**'" to locate all the files in directories named hgweb. OTOH, "hg locate '*l'" will locate only files that end with "l" - e.g. a file called "hg.py" will not be matched just because it's in a directory whose name ends with "l" (e.g. "mercurial").
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Wed, 04 Apr 2007 04:22:06 -0300
parents 6cecaec07cc9
children d4f0405fadac
comparison
equal deleted inserted replaced
4303:6cecaec07cc9 4304:702f48570eb3
434 if kind == 're': 434 if kind == 're':
435 return name 435 return name
436 elif kind == 'path': 436 elif kind == 'path':
437 return '^' + re.escape(name) + '(?:/|$)' 437 return '^' + re.escape(name) + '(?:/|$)'
438 elif kind == 'relglob': 438 elif kind == 'relglob':
439 return globre(name, '(?:|.*/)', '(?:/|$)') 439 return globre(name, '(?:|.*/)', tail)
440 elif kind == 'relpath': 440 elif kind == 'relpath':
441 return re.escape(name) + '(?:/|$)' 441 return re.escape(name) + '(?:/|$)'
442 elif kind == 'relre': 442 elif kind == 'relre':
443 if name.startswith('^'): 443 if name.startswith('^'):
444 return name 444 return name