Show More
@@ -487,7 +487,7 b' class revlog(object):' | |||
|
487 | 487 | raise |
|
488 | 488 | return b'' |
|
489 | 489 | |
|
490 | def _loadindex(self): | |
|
490 | def _loadindex(self, docket=None): | |
|
491 | 491 | |
|
492 | 492 | new_header, mmapindexthreshold, force_nodemap = self._init_opts() |
|
493 | 493 | |
@@ -498,45 +498,51 b' class revlog(object):' | |||
|
498 | 498 | else: |
|
499 | 499 | entry_point = b'%s.i' % self.radix |
|
500 | 500 | |
|
501 | entry_data = b'' | |
|
502 |
self._ |
|
|
503 | entry_data = self._get_data(entry_point, mmapindexthreshold) | |
|
504 | if len(entry_data) > 0: | |
|
505 | header = INDEX_HEADER.unpack(entry_data[:4])[0] | |
|
506 | self._initempty = False | |
|
501 | if docket is not None: | |
|
502 | self._docket = docket | |
|
503 | self._docket_file = entry_point | |
|
507 | 504 | else: |
|
508 | header = new_header | |
|
509 | ||
|
510 | self._format_flags = header & ~0xFFFF | |
|
511 | self._format_version = header & 0xFFFF | |
|
512 | ||
|
513 | supported_flags = SUPPORTED_FLAGS.get(self._format_version) | |
|
514 | if supported_flags is None: | |
|
515 | msg = _(b'unknown version (%d) in revlog %s') | |
|
516 | msg %= (self._format_version, self.display_id) | |
|
517 | raise error.RevlogError(msg) | |
|
518 | elif self._format_flags & ~supported_flags: | |
|
519 | msg = _(b'unknown flags (%#04x) in version %d revlog %s') | |
|
520 | display_flag = self._format_flags >> 16 | |
|
521 | msg %= (display_flag, self._format_version, self.display_id) | |
|
522 | raise error.RevlogError(msg) | |
|
523 | ||
|
524 | features = FEATURES_BY_VERSION[self._format_version] | |
|
525 | self._inline = features[b'inline'](self._format_flags) | |
|
526 | self._generaldelta = features[b'generaldelta'](self._format_flags) | |
|
527 | self.hassidedata = features[b'sidedata'] | |
|
528 | ||
|
529 | if not features[b'docket']: | |
|
530 | self._indexfile = entry_point | |
|
531 | index_data = entry_data | |
|
532 | else: | |
|
533 | self._docket_file = entry_point | |
|
534 | if self._initempty: | |
|
535 | self._docket = docketutil.default_docket(self, header) | |
|
505 | entry_data = b'' | |
|
506 | self._initempty = True | |
|
507 | entry_data = self._get_data(entry_point, mmapindexthreshold) | |
|
508 | if len(entry_data) > 0: | |
|
509 | header = INDEX_HEADER.unpack(entry_data[:4])[0] | |
|
510 | self._initempty = False | |
|
536 | 511 | else: |
|
537 | self._docket = docketutil.parse_docket( | |
|
538 | self, entry_data, use_pending=self._trypending | |
|
539 | ) | |
|
512 | header = new_header | |
|
513 | ||
|
514 | self._format_flags = header & ~0xFFFF | |
|
515 | self._format_version = header & 0xFFFF | |
|
516 | ||
|
517 | supported_flags = SUPPORTED_FLAGS.get(self._format_version) | |
|
518 | if supported_flags is None: | |
|
519 | msg = _(b'unknown version (%d) in revlog %s') | |
|
520 | msg %= (self._format_version, self.display_id) | |
|
521 | raise error.RevlogError(msg) | |
|
522 | elif self._format_flags & ~supported_flags: | |
|
523 | msg = _(b'unknown flags (%#04x) in version %d revlog %s') | |
|
524 | display_flag = self._format_flags >> 16 | |
|
525 | msg %= (display_flag, self._format_version, self.display_id) | |
|
526 | raise error.RevlogError(msg) | |
|
527 | ||
|
528 | features = FEATURES_BY_VERSION[self._format_version] | |
|
529 | self._inline = features[b'inline'](self._format_flags) | |
|
530 | self._generaldelta = features[b'generaldelta'](self._format_flags) | |
|
531 | self.hassidedata = features[b'sidedata'] | |
|
532 | ||
|
533 | if not features[b'docket']: | |
|
534 | self._indexfile = entry_point | |
|
535 | index_data = entry_data | |
|
536 | else: | |
|
537 | self._docket_file = entry_point | |
|
538 | if self._initempty: | |
|
539 | self._docket = docketutil.default_docket(self, header) | |
|
540 | else: | |
|
541 | self._docket = docketutil.parse_docket( | |
|
542 | self, entry_data, use_pending=self._trypending | |
|
543 | ) | |
|
544 | ||
|
545 | if self._docket is not None: | |
|
540 | 546 | self._indexfile = self._docket.index_filepath() |
|
541 | 547 | index_data = b'' |
|
542 | 548 | index_size = self._docket.index_end |
General Comments 0
You need to be logged in to leave comments.
Login now