equal
deleted
inserted
replaced
1211 # don't try to use cache - fall back to the slow path |
1211 # don't try to use cache - fall back to the slow path |
1212 self.branchinfo = self._branchinfo |
1212 self.branchinfo = self._branchinfo |
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( |
1224 b"couldn't read revision branch cache: %s\n" |
1225 b"couldn't read revision branch cache: %s\n" |
1225 % stringutil.forcebytestr(inst) |
1226 % stringutil.forcebytestr(inst) |