--- a/mercurial/match.py Tue Apr 15 23:29:19 2014 -0400
+++ b/mercurial/match.py Thu Oct 03 18:01:21 2013 +0200
@@ -59,7 +59,7 @@
self._root = root
self._cwd = cwd
- self._files = []
+ self._files = [] # exact files and roots of patterns
self._anypats = bool(include or exclude)
self._ctx = ctx
self._always = False
@@ -337,6 +337,15 @@
return pats
def _roots(patterns):
+ '''return roots and exact explicitly listed files from patterns
+
+ >>> _roots([('glob', 'g/*'), ('glob', 'g'), ('glob', 'g*')])
+ ['g', 'g', '.']
+ >>> _roots([('relpath', 'r'), ('path', 'p/p'), ('path', '')])
+ ['r', 'p/p', '.']
+ >>> _roots([('relglob', 'rg*'), ('re', 're/'), ('relre', 'rr')])
+ ['.', '.', '.']
+ '''
r = []
for kind, name in patterns:
if kind == 'glob': # find the non-glob prefix