##// END OF EJS Templates
match: add root to _buildmatch...
Durham Goode -
r25238:5a55ad6e default
parent child Browse files
Show More
@@ -94,7 +94,7 b' class match(object):'
94 if include:
94 if include:
95 kindpats = self._normalize(include, 'glob', root, cwd, auditor)
95 kindpats = self._normalize(include, 'glob', root, cwd, auditor)
96 self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)',
96 self.includepat, im = _buildmatch(ctx, kindpats, '(?:/|$)',
97 listsubrepos)
97 listsubrepos, root)
98 self._includeroots.update(_roots(kindpats))
98 self._includeroots.update(_roots(kindpats))
99 self._includeroots.discard('.')
99 self._includeroots.discard('.')
100 self._includedirs.update(util.dirs(self._includeroots))
100 self._includedirs.update(util.dirs(self._includeroots))
@@ -102,7 +102,7 b' class match(object):'
102 if exclude:
102 if exclude:
103 kindpats = self._normalize(exclude, 'glob', root, cwd, auditor)
103 kindpats = self._normalize(exclude, 'glob', root, cwd, auditor)
104 self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)',
104 self.excludepat, em = _buildmatch(ctx, kindpats, '(?:/|$)',
105 listsubrepos)
105 listsubrepos, root)
106 self._excluderoots.update(_roots(kindpats))
106 self._excluderoots.update(_roots(kindpats))
107 self._excluderoots.discard('.')
107 self._excluderoots.discard('.')
108 matchfns.append(lambda f: not em(f))
108 matchfns.append(lambda f: not em(f))
@@ -118,7 +118,7 b' class match(object):'
118 self._files = _roots(kindpats)
118 self._files = _roots(kindpats)
119 self._anypats = self._anypats or _anypats(kindpats)
119 self._anypats = self._anypats or _anypats(kindpats)
120 self.patternspat, pm = _buildmatch(ctx, kindpats, '$',
120 self.patternspat, pm = _buildmatch(ctx, kindpats, '$',
121 listsubrepos)
121 listsubrepos, root)
122 matchfns.append(pm)
122 matchfns.append(pm)
123
123
124 if not matchfns:
124 if not matchfns:
@@ -476,7 +476,7 b' def _regex(kind, pat, globsuffix):'
476 return '.*' + pat
476 return '.*' + pat
477 return _globre(pat) + globsuffix
477 return _globre(pat) + globsuffix
478
478
479 def _buildmatch(ctx, kindpats, globsuffix, listsubrepos):
479 def _buildmatch(ctx, kindpats, globsuffix, listsubrepos, root):
480 '''Return regexp string and a matcher function for kindpats.
480 '''Return regexp string and a matcher function for kindpats.
481 globsuffix is appended to the regexp of globs.'''
481 globsuffix is appended to the regexp of globs.'''
482 fset, kindpats = _expandsets(kindpats, ctx, listsubrepos)
482 fset, kindpats = _expandsets(kindpats, ctx, listsubrepos)
General Comments 0
You need to be logged in to leave comments. Login now