##// END OF EJS Templates
revlog: fix reading of larger revlog indices on Windows
Matt Mackall -
r8558:5726bb29 default
parent child Browse files
Show More
@@ -322,7 +322,7 b' class revlogoldio(object):'
322 322 index = []
323 323 nodemap = {nullid: nullrev}
324 324 n = off = 0
325 if len(data) < _prereadsize:
325 if len(data) == _prereadsize:
326 326 data += fp.read() # read the rest
327 327 l = len(data)
328 328 while off + s <= l:
@@ -362,14 +362,8 b' class revlogio(object):'
362 362 self.size = struct.calcsize(indexformatng)
363 363
364 364 def parseindex(self, fp, data, inline):
365 try:
366 size = len(data)
367 if size == _prereadsize:
368 size = util.fstat(fp).st_size
369 except AttributeError:
370 size = 0
371
372 if util.openhardlinks() and not inline and size > _prereadsize:
365 if len(data) == _prereadsize:
366 if util.openhardlinks() and not inline:
373 367 # big index, let's parse it on demand
374 368 parser = lazyparser(fp, size)
375 369 index = lazyindex(parser)
@@ -379,6 +373,8 b' class revlogio(object):'
379 373 e[0] = offset_type(0, type)
380 374 index[0] = e
381 375 return index, nodemap, None
376 else:
377 data += fp.read()
382 378
383 379 # call the C implementation to parse the index data
384 380 index, nodemap, cache = parsers.parse_index(data, inline)
General Comments 0
You need to be logged in to leave comments. Login now