##// END OF EJS Templates
revlog: directly use self._format_version when loading index...
marmoute -
r47944:ef7a8a16 default
parent child Browse files
Show More
@@ -491,34 +491,31 b' class revlog(object):'
491 header = new_header
491 header = new_header
492
492
493 flags = self._format_flags = header & ~0xFFFF
493 flags = self._format_flags = header & ~0xFFFF
494 fmt = self._format_version = header & 0xFFFF
494 self._format_version = header & 0xFFFF
495
495
496 if fmt == REVLOGV0:
496 if self._format_version == REVLOGV0:
497 if flags:
497 if flags:
498 raise error.RevlogError(
498 msg = _(b'unknown flags (%#04x) in version %d revlog %s')
499 _(b'unknown flags (%#04x) in version %d revlog %s')
499 msg %= (flags >> 16, self._format_version, self.display_id)
500 % (flags >> 16, fmt, self.display_id)
500 raise error.RevlogError(msg)
501 )
502
501
503 self._inline = False
502 self._inline = False
504 self._generaldelta = False
503 self._generaldelta = False
505
504
506 elif fmt == REVLOGV1:
505 elif self._format_version == REVLOGV1:
507 if flags & ~REVLOGV1_FLAGS:
506 if flags & ~REVLOGV1_FLAGS:
508 raise error.RevlogError(
507 msg = _(b'unknown flags (%#04x) in version %d revlog %s')
509 _(b'unknown flags (%#04x) in version %d revlog %s')
508 msg %= (flags >> 16, self._format_version, self.display_id)
510 % (flags >> 16, fmt, self.display_id)
509 raise error.RevlogError(msg)
511 )
512
510
513 self._inline = self._format_flags & FLAG_INLINE_DATA
511 self._inline = self._format_flags & FLAG_INLINE_DATA
514 self._generaldelta = self._format_flags & FLAG_GENERALDELTA
512 self._generaldelta = self._format_flags & FLAG_GENERALDELTA
515
513
516 elif fmt == REVLOGV2:
514 elif self._format_version == REVLOGV2:
517 if flags & ~REVLOGV2_FLAGS:
515 if flags & ~REVLOGV2_FLAGS:
518 raise error.RevlogError(
516 msg = _(b'unknown flags (%#04x) in version %d revlog %s')
519 _(b'unknown flags (%#04x) in version %d revlog %s')
517 msg %= (flags >> 16, self._format_version, self.display_id)
520 % (flags >> 16, fmt, self.display_id)
518 raise error.RevlogError(msg)
521 )
522
519
523 # There is a bug in the transaction handling when going from an
520 # There is a bug in the transaction handling when going from an
524 # inline revlog to a separate index and data file. Turn it off until
521 # inline revlog to a separate index and data file. Turn it off until
@@ -529,9 +526,9 b' class revlog(object):'
529 self._generaldelta = True
526 self._generaldelta = True
530
527
531 else:
528 else:
532 raise error.RevlogError(
529 msg = _(b'unknown version (%d) in revlog %s')
533 _(b'unknown version (%d) in revlog %s') % (fmt, self.display_id)
530 msg %= (self._format_version, self.display_id)
534 )
531 raise error.RevlogError(msg)
535
532
536 self.nodeconstants = sha1nodeconstants
533 self.nodeconstants = sha1nodeconstants
537 self.nullid = self.nodeconstants.nullid
534 self.nullid = self.nodeconstants.nullid
@@ -558,7 +555,7 b' class revlog(object):'
558 self._parse_index = parse_index_v1
555 self._parse_index = parse_index_v1
559 if self._format_version == REVLOGV0:
556 if self._format_version == REVLOGV0:
560 self._parse_index = revlogv0.parse_index_v0
557 self._parse_index = revlogv0.parse_index_v0
561 elif fmt == REVLOGV2:
558 elif self._format_version == REVLOGV2:
562 self._parse_index = parse_index_v2
559 self._parse_index = parse_index_v2
563 elif devel_nodemap:
560 elif devel_nodemap:
564 self._parse_index = parse_index_v1_nodemap
561 self._parse_index = parse_index_v1_nodemap
General Comments 0
You need to be logged in to leave comments. Login now