mercurial/revlog.py
changeset 47266 921648d31553
parent 47263 6c84fc9c9a90
child 47269 6be2a7ca4b1d
equal deleted inserted replaced
47265:a07381751dc9 47266:921648d31553
    33 )
    33 )
    34 from .i18n import _
    34 from .i18n import _
    35 from .pycompat import getattr
    35 from .pycompat import getattr
    36 from .revlogutils.constants import (
    36 from .revlogutils.constants import (
    37     ALL_KINDS,
    37     ALL_KINDS,
       
    38     CHANGELOGV2,
    38     COMP_MODE_DEFAULT,
    39     COMP_MODE_DEFAULT,
    39     COMP_MODE_INLINE,
    40     COMP_MODE_INLINE,
    40     COMP_MODE_PLAIN,
    41     COMP_MODE_PLAIN,
    41     FEATURES_BY_VERSION,
    42     FEATURES_BY_VERSION,
    42     FLAG_GENERALDELTA,
    43     FLAG_GENERALDELTA,
   458         """
   459         """
   459         mmapindexthreshold = None
   460         mmapindexthreshold = None
   460         opts = self.opener.options
   461         opts = self.opener.options
   461 
   462 
   462         if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
   463         if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
   463             new_header = REVLOGV2
   464             new_header = CHANGELOGV2
   464         elif b'revlogv2' in opts:
   465         elif b'revlogv2' in opts:
   465             new_header = REVLOGV2
   466             new_header = REVLOGV2
   466         elif b'revlogv1' in opts:
   467         elif b'revlogv1' in opts:
   467             new_header = REVLOGV1 | FLAG_INLINE_DATA
   468             new_header = REVLOGV1 | FLAG_INLINE_DATA
   468             if b'generaldelta' in opts:
   469             if b'generaldelta' in opts:
   647 
   648 
   648         self._parse_index = parse_index_v1
   649         self._parse_index = parse_index_v1
   649         if self._format_version == REVLOGV0:
   650         if self._format_version == REVLOGV0:
   650             self._parse_index = revlogv0.parse_index_v0
   651             self._parse_index = revlogv0.parse_index_v0
   651         elif self._format_version == REVLOGV2:
   652         elif self._format_version == REVLOGV2:
       
   653             self._parse_index = parse_index_v2
       
   654         elif self._format_version == CHANGELOGV2:
   652             self._parse_index = parse_index_v2
   655             self._parse_index = parse_index_v2
   653         elif devel_nodemap:
   656         elif devel_nodemap:
   654             self._parse_index = parse_index_v1_nodemap
   657             self._parse_index = parse_index_v1_nodemap
   655         elif use_rust_index:
   658         elif use_rust_index:
   656             self._parse_index = parse_index_v1_mixed
   659             self._parse_index = parse_index_v1_mixed