1225 return narrowspec.load(self) |
1225 return narrowspec.load(self) |
1226 |
1226 |
1227 @storecache(narrowspec.FILENAME) |
1227 @storecache(narrowspec.FILENAME) |
1228 def _storenarrowmatch(self): |
1228 def _storenarrowmatch(self): |
1229 if repository.NARROW_REQUIREMENT not in self.requirements: |
1229 if repository.NARROW_REQUIREMENT not in self.requirements: |
1230 return matchmod.always(self.root, '') |
1230 return matchmod.always() |
1231 include, exclude = self.narrowpats |
1231 include, exclude = self.narrowpats |
1232 return narrowspec.match(self.root, include=include, exclude=exclude) |
1232 return narrowspec.match(self.root, include=include, exclude=exclude) |
1233 |
1233 |
1234 @storecache(narrowspec.FILENAME) |
1234 @storecache(narrowspec.FILENAME) |
1235 def _narrowmatch(self): |
1235 def _narrowmatch(self): |
1236 if repository.NARROW_REQUIREMENT not in self.requirements: |
1236 if repository.NARROW_REQUIREMENT not in self.requirements: |
1237 return matchmod.always(self.root, '') |
1237 return matchmod.always() |
1238 narrowspec.checkworkingcopynarrowspec(self) |
1238 narrowspec.checkworkingcopynarrowspec(self) |
1239 include, exclude = self.narrowpats |
1239 include, exclude = self.narrowpats |
1240 return narrowspec.match(self.root, include=include, exclude=exclude) |
1240 return narrowspec.match(self.root, include=include, exclude=exclude) |
1241 |
1241 |
1242 def narrowmatch(self, match=None, includeexact=False): |
1242 def narrowmatch(self, match=None, includeexact=False): |
1250 """ |
1250 """ |
1251 if match: |
1251 if match: |
1252 if includeexact and not self._narrowmatch.always(): |
1252 if includeexact and not self._narrowmatch.always(): |
1253 # do not exclude explicitly-specified paths so that they can |
1253 # do not exclude explicitly-specified paths so that they can |
1254 # be warned later on |
1254 # be warned later on |
1255 em = matchmod.exact(None, None, match.files()) |
1255 em = matchmod.exact(match.files()) |
1256 nm = matchmod.unionmatcher([self._narrowmatch, em]) |
1256 nm = matchmod.unionmatcher([self._narrowmatch, em]) |
1257 return matchmod.intersectmatchers(match, nm) |
1257 return matchmod.intersectmatchers(match, nm) |
1258 return matchmod.intersectmatchers(match, self._narrowmatch) |
1258 return matchmod.intersectmatchers(match, self._narrowmatch) |
1259 return self._narrowmatch |
1259 return self._narrowmatch |
1260 |
1260 |