diff mercurial/revlogutils/constants.py @ 47260: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 616b8f412676
children 6bfa6c2c5f15
line wrap: on
line diff
--- a/mercurial/revlogutils/constants.py	Tue May 04 01:15:03 2021 +0200
+++ b/mercurial/revlogutils/constants.py	Mon May 03 18:19:16 2021 +0200
@@ -1,4 +1,4 @@
-# revlogdeltas.py - constant used for revlog logic
+# revlogdeltas.py - constant used for revlog logic.
 #
 # Copyright 2005-2007 Olivia Mackall <olivia@selenic.com>
 # Copyright 2018 Octobus <contact@octobus.net>
@@ -114,6 +114,14 @@
 # bitmark for flags that could cause rawdata content change
 REVIDX_RAWTEXT_CHANGING_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED
 
+## chunk compression mode constants:
+# These constants are used in revlog version >=2 to denote the compression used
+# for a chunk.
+
+# Chunk use a compression mode stored "inline" at the start of the chunk
+# itself.  This is the mode always used for revlog version "0" and "1"
+COMP_MODE_INLINE = 2
+
 SUPPORTED_FLAGS = {
     REVLOGV0: REVLOGV0_FLAGS,
     REVLOGV1: REVLOGV1_FLAGS,
@@ -152,4 +160,5 @@
     },
 }
 
+
 SPARSE_REVLOG_MAX_CHAIN_LENGTH = 1000