##// END OF EJS Templates
match: make it more clear what _roots do and that it ends up in match()._files
Mads Kiilerich -
r21079:b02ab648 default
parent child Browse files
Show More
@@ -59,7 +59,7 b' class match(object):'
59
59
60 self._root = root
60 self._root = root
61 self._cwd = cwd
61 self._cwd = cwd
62 self._files = []
62 self._files = [] # exact files and roots of patterns
63 self._anypats = bool(include or exclude)
63 self._anypats = bool(include or exclude)
64 self._ctx = ctx
64 self._ctx = ctx
65 self._always = False
65 self._always = False
@@ -337,6 +337,15 b' def _normalize(names, default, root, cwd'
337 return pats
337 return pats
338
338
339 def _roots(patterns):
339 def _roots(patterns):
340 '''return roots and exact explicitly listed files from patterns
341
342 >>> _roots([('glob', 'g/*'), ('glob', 'g'), ('glob', 'g*')])
343 ['g', 'g', '.']
344 >>> _roots([('relpath', 'r'), ('path', 'p/p'), ('path', '')])
345 ['r', 'p/p', '.']
346 >>> _roots([('relglob', 'rg*'), ('re', 're/'), ('relre', 'rr')])
347 ['.', '.', '.']
348 '''
340 r = []
349 r = []
341 for kind, name in patterns:
350 for kind, name in patterns:
342 if kind == 'glob': # find the non-glob prefix
351 if kind == 'glob': # find the non-glob prefix
General Comments 0
You need to be logged in to leave comments. Login now