##// END OF EJS Templates
match: more accurately report when we're always going to match...
Bryan O'Sullivan -
r18713:8728579f default
parent child Browse files
Show More
@@ -62,6 +62,7 b' class match(object):'
62 62 self._files = []
63 63 self._anypats = bool(include or exclude)
64 64 self._ctx = ctx
65 self._always = False
65 66
66 67 if include:
67 68 pats = _normalize(include, 'glob', root, cwd, auditor)
@@ -103,6 +104,7 b' class match(object):'
103 104 m = lambda f: not em(f)
104 105 else:
105 106 m = lambda f: True
107 self._always = True
106 108
107 109 self.matchfn = m
108 110 self._fmap = set(self._files)
@@ -130,7 +132,7 b' class match(object):'
130 132 def anypats(self):
131 133 return self._anypats
132 134 def always(self):
133 return False
135 return self._always
134 136
135 137 class exact(match):
136 138 def __init__(self, root, cwd, files):
@@ -139,8 +141,7 b' class exact(match):'
139 141 class always(match):
140 142 def __init__(self, root, cwd):
141 143 match.__init__(self, root, cwd, [])
142 def always(self):
143 return True
144 self._always = True
144 145
145 146 class narrowmatcher(match):
146 147 """Adapt a matcher to work on a subdirectory only.
@@ -175,6 +176,7 b' class narrowmatcher(match):'
175 176 self._cwd = matcher._cwd
176 177 self._path = path
177 178 self._matcher = matcher
179 self._always = matcher._always
178 180
179 181 self._files = [f[len(path) + 1:] for f in matcher._files
180 182 if f.startswith(path + "/")]
General Comments 0
You need to be logged in to leave comments. Login now