##// END OF EJS Templates
narrow: extract repo property for store narrowmatcher...
Martin von Zweigbergk -
r41266:d2d716cc default
parent child Browse files
Show More
@@ -243,7 +243,7 b' def _reposetup(ui, repo):'
243 s = repo.set('%n:%n', _bin(kwargs[r'node']), _bin(last))
243 s = repo.set('%n:%n', _bin(kwargs[r'node']), _bin(last))
244 else:
244 else:
245 s = repo.set('%n', _bin(kwargs[r'node']))
245 s = repo.set('%n', _bin(kwargs[r'node']))
246 match = repo.narrowmatch()
246 match = repo._storenarrowmatch
247 for ctx in s:
247 for ctx in s:
248 # TODO: is there a way to just walk the files in the commit?
248 # TODO: is there a way to just walk the files in the commit?
249 if any(ctx[f].islfs() for f in ctx.files()
249 if any(ctx[f].islfs() for f in ctx.files()
@@ -815,7 +815,7 b' class revlognarrowfilestorage(object):'
815 if path[0] == b'/':
815 if path[0] == b'/':
816 path = path[1:]
816 path = path[1:]
817
817
818 return filelog.narrowfilelog(self.svfs, path, self.narrowmatch())
818 return filelog.narrowfilelog(self.svfs, path, self._storenarrowmatch)
819
819
820 def makefilestorage(requirements, features, **kwargs):
820 def makefilestorage(requirements, features, **kwargs):
821 """Produce a type conforming to ``ilocalrepositoryfilestorage``."""
821 """Produce a type conforming to ``ilocalrepositoryfilestorage``."""
@@ -1191,7 +1191,7 b' class localrepository(object):'
1191 def manifestlog(self):
1191 def manifestlog(self):
1192 rootstore = manifest.manifestrevlog(self.svfs)
1192 rootstore = manifest.manifestrevlog(self.svfs)
1193 return manifest.manifestlog(self.svfs, self, rootstore,
1193 return manifest.manifestlog(self.svfs, self, rootstore,
1194 self.narrowmatch())
1194 self._storenarrowmatch)
1195
1195
1196 @repofilecache('dirstate')
1196 @repofilecache('dirstate')
1197 def dirstate(self):
1197 def dirstate(self):
@@ -1224,6 +1224,13 b' class localrepository(object):'
1224 return narrowspec.load(self)
1224 return narrowspec.load(self)
1225
1225
1226 @storecache(narrowspec.FILENAME)
1226 @storecache(narrowspec.FILENAME)
1227 def _storenarrowmatch(self):
1228 if repository.NARROW_REQUIREMENT not in self.requirements:
1229 return matchmod.always(self.root, '')
1230 include, exclude = self.narrowpats
1231 return narrowspec.match(self.root, include=include, exclude=exclude)
1232
1233 @storecache(narrowspec.FILENAME)
1227 def _narrowmatch(self):
1234 def _narrowmatch(self):
1228 if repository.NARROW_REQUIREMENT not in self.requirements:
1235 if repository.NARROW_REQUIREMENT not in self.requirements:
1229 return matchmod.always(self.root, '')
1236 return matchmod.always(self.root, '')
General Comments 0
You need to be logged in to leave comments. Login now