mercurial/localrepo.py
branchstable
changeset 50316 87f0155d68aa
parent 50301 9fc0d244a753
child 50323 6901916458bd
equal deleted inserted replaced
50315:cf6e1d535602 50316:87f0155d68aa
  1238 
  1238 
  1239     def file(self, path):
  1239     def file(self, path):
  1240         if path.startswith(b'/'):
  1240         if path.startswith(b'/'):
  1241             path = path[1:]
  1241             path = path[1:]
  1242 
  1242 
  1243         return filelog.filelog(self.svfs, path)
  1243         try_split = (
       
  1244             self.currenttransaction() is not None
       
  1245             or txnutil.mayhavepending(self.root)
       
  1246         )
       
  1247 
       
  1248         return filelog.filelog(self.svfs, path, try_split=try_split)
  1244 
  1249 
  1245 
  1250 
  1246 @interfaceutil.implementer(repository.ilocalrepositoryfilestorage)
  1251 @interfaceutil.implementer(repository.ilocalrepositoryfilestorage)
  1247 class revlognarrowfilestorage:
  1252 class revlognarrowfilestorage:
  1248     """File storage when using revlogs and narrow files."""
  1253     """File storage when using revlogs and narrow files."""
  1249 
  1254 
  1250     def file(self, path):
  1255     def file(self, path):
  1251         if path.startswith(b'/'):
  1256         if path.startswith(b'/'):
  1252             path = path[1:]
  1257             path = path[1:]
  1253 
  1258 
  1254         return filelog.narrowfilelog(self.svfs, path, self._storenarrowmatch)
  1259         try_split = (
       
  1260             self.currenttransaction() is not None
       
  1261             or txnutil.mayhavepending(self.root)
       
  1262         )
       
  1263         return filelog.narrowfilelog(
       
  1264             self.svfs, path, self._storenarrowmatch, try_split=try_split
       
  1265         )
  1255 
  1266 
  1256 
  1267 
  1257 def makefilestorage(requirements, features, **kwargs):
  1268 def makefilestorage(requirements, features, **kwargs):
  1258     """Produce a type conforming to ``ilocalrepositoryfilestorage``."""
  1269     """Produce a type conforming to ``ilocalrepositoryfilestorage``."""
  1259     features.add(repository.REPO_FEATURE_REVLOG_FILE_STORAGE)
  1270     features.add(repository.REPO_FEATURE_REVLOG_FILE_STORAGE)