##// END OF EJS Templates
mmap: only use mmap to read rev-branch-cache data if it is safe...
marmoute -
r52547:c0e30a01 stable
parent child Browse files
Show More
@@ -1213,11 +1213,12 b' class revbranchcache:'
1213
1213
1214 if self._names:
1214 if self._names:
1215 try:
1215 try:
1216 if repo.ui.configbool(b'storage', b'revbranchcache.mmap'):
1216 usemmap = repo.ui.configbool(b'storage', b'revbranchcache.mmap')
1217 with repo.cachevfs(_rbcrevs) as fp:
1217 with repo.cachevfs(_rbcrevs) as fp:
1218 if usemmap and repo.cachevfs.is_mmap_safe(_rbcrevs):
1218 data = util.buffer(util.mmapread(fp))
1219 data = util.buffer(util.mmapread(fp))
1219 else:
1220 else:
1220 data = repo.cachevfs.read(_rbcrevs)
1221 data = fp.read()
1221 self._rbcrevs = rbcrevs(data)
1222 self._rbcrevs = rbcrevs(data)
1222 except (IOError, OSError) as inst:
1223 except (IOError, OSError) as inst:
1223 repo.ui.debug(
1224 repo.ui.debug(
General Comments 0
You need to be logged in to leave comments. Login now