Show More
@@ -378,32 +378,32 b' class revlog(object):' | |||
|
378 | 378 | raise RevlogError(_("index %s unknown format %d") |
|
379 | 379 | % (self.indexfile, fmt)) |
|
380 | 380 | self.version = v |
|
381 | if v == REVLOGV0: | |
|
381 | self.nodemap = {nullid: nullrev} | |
|
382 | self.index = [] | |
|
383 | self.indexformat = indexformatng | |
|
384 | if self.version == REVLOGV0: | |
|
382 | 385 | self.indexformat = indexformatv0 |
|
386 | if i: | |
|
387 | self._parseindex(f, st) | |
|
388 | ||
|
389 | def _parseindex(self, fp, st): | |
|
390 | shaoffset = ngshaoffset | |
|
391 | if self.version == REVLOGV0: | |
|
383 | 392 | shaoffset = v0shaoffset |
|
384 | else: | |
|
385 | self.indexformat = indexformatng | |
|
386 | shaoffset = ngshaoffset | |
|
387 | 393 | |
|
388 | if i: | |
|
389 | 394 |
|
|
390 | 395 |
|
|
391 | 396 |
|
|
392 |
|
|
|
397 | parser = lazyparser(fp, st.st_size, self.indexformat, shaoffset) | |
|
393 | 398 |
|
|
394 | 399 |
|
|
395 | else: | |
|
396 | self._parseindex(f, st) | |
|
397 | 400 | if self.version != REVLOGV0: |
|
398 | 401 | e = list(self.index[0]) |
|
399 | 402 | type = gettype(e[0]) |
|
400 | 403 | e[0] = offset_type(0, type) |
|
401 | 404 | self.index[0] = e |
|
402 | else: | |
|
403 | self.nodemap = {nullid: nullrev} | |
|
404 | self.index = [] | |
|
405 | return | |
|
405 | 406 | |
|
406 | def _parseindex(self, fp, st): | |
|
407 | 407 | s = struct.calcsize(self.indexformat) |
|
408 | 408 | self.index = [] |
|
409 | 409 | self.nodemap = {nullid: nullrev} |
@@ -447,6 +447,11 b' class revlog(object):' | |||
|
447 | 447 | if not st: |
|
448 | 448 | break |
|
449 | 449 | |
|
450 | if self.version != REVLOGV0: | |
|
451 | e = list(self.index[0]) | |
|
452 | type = gettype(e[0]) | |
|
453 | e[0] = offset_type(0, type) | |
|
454 | self.index[0] = e | |
|
450 | 455 | |
|
451 | 456 | def _loadindex(self, start, end): |
|
452 | 457 | """load a block of indexes all at once from the lazy parser""" |
General Comments 0
You need to be logged in to leave comments.
Login now