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