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) |