Show More
@@ -333,44 +333,22 b' class revlogio(object):' | |||
|
333 | 333 | s = struct.calcsize(indexformatng) |
|
334 | 334 | index = [] |
|
335 | 335 | nodemap = {nullid: nullrev} |
|
336 | n = 0 | |
|
337 | leftover = None | |
|
338 | while True: | |
|
339 | if st: | |
|
340 | data = fp.read(65536) | |
|
341 | else: | |
|
342 | # hack for httprangereader, it doesn't do partial reads well | |
|
343 | data = fp.read() | |
|
344 |
i |
|
|
345 | break | |
|
346 |
|
|
|
347 | # cache the first chunk | |
|
348 | self.chunkcache = (0, data) | |
|
349 |
if |
|
|
350 | data = leftover + data | |
|
351 | leftover = None | |
|
352 | off = 0 | |
|
353 | l = len(data) | |
|
354 | while off < l: | |
|
355 | if l - off < s: | |
|
356 | leftover = data[off:] | |
|
336 | n = off = 0 | |
|
337 | # if we're not using lazymap, always read the whole index | |
|
338 | data = fp.read() | |
|
339 | l = len(data) | |
|
340 | if inline: | |
|
341 | self.chunkcache = (0, data) | |
|
342 | while off + s <= l: | |
|
343 | e = struct.unpack(indexformatng, data[off:off + s]) | |
|
344 | index.append(e) | |
|
345 | nodemap[e[-1]] = n | |
|
346 | n += 1 | |
|
347 | off += s | |
|
348 | if inline: | |
|
349 | if e[1] < 0: | |
|
357 | 350 | break |
|
358 |
|
|
|
359 | off += s | |
|
360 | e = struct.unpack(indexformatng, cur) | |
|
361 | index.append(e) | |
|
362 | nodemap[e[-1]] = n | |
|
363 | n += 1 | |
|
364 | if inline: | |
|
365 | if e[1] < 0: | |
|
366 | break | |
|
367 | off += e[1] | |
|
368 | if off > l: | |
|
369 | # some things don't seek well, just read it | |
|
370 | fp.read(off - l) | |
|
371 | break | |
|
372 | if not st: | |
|
373 | break | |
|
351 | off += e[1] | |
|
374 | 352 | |
|
375 | 353 | e = list(index[0]) |
|
376 | 354 | type = gettype(e[0]) |
General Comments 0
You need to be logged in to leave comments.
Login now