comparison mercurial/revlog.py @ 47249:130c9f7ed914

revlog: add a "data compression mode" entry in the index tuple That will make it possible to keep track of compression information in the revlog index, opening the way to more efficient revision restoration (in native code, but the python usage is already defeating performance work). We start with adding a new entry to the index tuple, using a value matching the current behavior. We will introduce storage and other value in later changesets. Differential Revision: https://phab.mercurial-scm.org/D10646
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 18:19:16 +0200
parents 02a4463565ea
children e340b556a13e
comparison
equal deleted inserted replaced
47248:013c645dd28c 47249:130c9f7ed914
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 COMP_MODE_INLINE,
38 FEATURES_BY_VERSION, 39 FEATURES_BY_VERSION,
39 FLAG_GENERALDELTA, 40 FLAG_GENERALDELTA,
40 FLAG_INLINE_DATA, 41 FLAG_INLINE_DATA,
41 INDEX_HEADER, 42 INDEX_HEADER,
42 REVLOGV0, 43 REVLOGV0,
334 [8] sidedata offset: 335 [8] sidedata offset:
335 The byte index of the start of the revision's side-data chunk. 336 The byte index of the start of the revision's side-data chunk.
336 337
337 [9] sidedata chunk length: 338 [9] sidedata chunk length:
338 The size, in bytes, of the revision's side-data chunk. 339 The size, in bytes, of the revision's side-data chunk.
340
341 [10] data compression mode:
342 two bits that detail the way the data chunk is compressed on disk.
343 (see "COMP_MODE_*" constants for details). For revlog version 0 and
344 1 this will always be COMP_MODE_INLINE.
345
339 """ 346 """
340 347
341 _flagserrorclass = error.RevlogError 348 _flagserrorclass = error.RevlogError
342 349
343 def __init__( 350 def __init__(
2472 p1r, 2479 p1r,
2473 p2r, 2480 p2r,
2474 node, 2481 node,
2475 sidedata_offset, 2482 sidedata_offset,
2476 len(serialized_sidedata), 2483 len(serialized_sidedata),
2484 COMP_MODE_INLINE,
2477 ) 2485 )
2478 2486
2479 self.index.append(e) 2487 self.index.append(e)
2480 entry = self.index.entry_binary(curr) 2488 entry = self.index.entry_binary(curr)
2481 if curr == 0 and self._docket is None: 2489 if curr == 0 and self._docket is None: