sidedata: add a new revision flag constant for side data
authorPierre-Yves David <pierre-yves.david@octobus.net>
Wed, 07 Aug 2019 17:55:44 +0200
changeset 43032 a12a9af7536c
parent 43031 e16ca9fde7aa
child 43033 21025a4107d4
sidedata: add a new revision flag constant for side data Small step first. Differential Revision: https://phab.mercurial-scm.org/D6888
mercurial/interfaces/repository.py
mercurial/revlogutils/constants.py
--- a/mercurial/interfaces/repository.py	Wed Sep 04 02:43:17 2019 +0200
+++ b/mercurial/interfaces/repository.py	Wed Aug 07 17:55:44 2019 +0200
@@ -35,9 +35,12 @@
 REVISION_FLAG_CENSORED = 1 << 15
 REVISION_FLAG_ELLIPSIS = 1 << 14
 REVISION_FLAG_EXTSTORED = 1 << 13
+REVISION_FLAG_SIDEDATA = 1 << 12
 
 REVISION_FLAGS_KNOWN = (
-    REVISION_FLAG_CENSORED | REVISION_FLAG_ELLIPSIS | REVISION_FLAG_EXTSTORED)
+    REVISION_FLAG_CENSORED | REVISION_FLAG_ELLIPSIS | REVISION_FLAG_EXTSTORED
+    | REVISION_FLAG_SIDEDATA
+)
 
 CG_DELTAMODE_STD = b'default'
 CG_DELTAMODE_PREV = b'previous'
--- a/mercurial/revlogutils/constants.py	Wed Sep 04 02:43:17 2019 +0200
+++ b/mercurial/revlogutils/constants.py	Wed Aug 07 17:55:44 2019 +0200
@@ -40,16 +40,23 @@
 REVIDX_ELLIPSIS = repository.REVISION_FLAG_ELLIPSIS
 # revision data is stored externally
 REVIDX_EXTSTORED = repository.REVISION_FLAG_EXTSTORED
+# revision data contains extra metadata not part of the official digest
+REVIDX_SIDEDATA = repository.REVISION_FLAG_SIDEDATA
 REVIDX_DEFAULT_FLAGS = 0
 # stable order in which flags need to be processed and their processors applied
 REVIDX_FLAGS_ORDER = [
     REVIDX_ISCENSORED,
     REVIDX_ELLIPSIS,
     REVIDX_EXTSTORED,
+    REVIDX_SIDEDATA,
 ]
 
 # bitmark for flags that could cause rawdata content change
-REVIDX_RAWTEXT_CHANGING_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED
+REVIDX_RAWTEXT_CHANGING_FLAGS = (
+    REVIDX_ISCENSORED
+    | REVIDX_EXTSTORED
+    | REVIDX_SIDEDATA
+)
 
 SPARSE_REVLOG_MAX_CHAIN_LENGTH = 1000