mercurial/localrepo.py
changeset 41230 d2d716cc0700
parent 41229 50ca531f1f24
child 41235 a2ae27993e16
equal deleted inserted replaced
41229:50ca531f1f24 41230:d2d716cc0700
   813 
   813 
   814     def file(self, path):
   814     def file(self, path):
   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``."""
   822     features.add(repository.REPO_FEATURE_REVLOG_FILE_STORAGE)
   822     features.add(repository.REPO_FEATURE_REVLOG_FILE_STORAGE)
   823     features.add(repository.REPO_FEATURE_STREAM_CLONE)
   823     features.add(repository.REPO_FEATURE_STREAM_CLONE)
  1189 
  1189 
  1190     @storecache('00manifest.i')
  1190     @storecache('00manifest.i')
  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):
  1198         return self._makedirstate()
  1198         return self._makedirstate()
  1199 
  1199 
  1220         """matcher patterns for this repository's narrowspec
  1220         """matcher patterns for this repository's narrowspec
  1221 
  1221 
  1222         A tuple of (includes, excludes).
  1222         A tuple of (includes, excludes).
  1223         """
  1223         """
  1224         return narrowspec.load(self)
  1224         return narrowspec.load(self)
       
  1225 
       
  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)
  1225 
  1232 
  1226     @storecache(narrowspec.FILENAME)
  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, '')