[PATCH 6 of 7 flagprocessor v7] revlog: REVIDX_USR[0-3] flags

Remi Chaintron remi at fb.com
Mon Jan 2 12:51:16 EST 2017


# HG changeset patch
# User Remi Chaintron <remi at fb.com>
# Date 1483377423 18000
#      Mon Jan 02 12:17:03 2017 -0500
# Node ID d4aaac74e17118d59373b8380fcd98b7bb0419d8
# Parent  8a72e38f826c86f2a9ede795198a016c330734de
revlog: REVIDX_USR[0-3] flags

This patch introduces four flags for user extensions to register transforms on.
These flags will be used for extensions that do not belong to core, allowing
them to register flag transforms according to their behavior.
These flags will also be used to in the test-flagprocessor.t test in the
following patch.

diff --git a/mercurial/help/internals/revlogs.txt b/mercurial/help/internals/revlogs.txt
--- a/mercurial/help/internals/revlogs.txt
+++ b/mercurial/help/internals/revlogs.txt
@@ -91,6 +91,7 @@
    Bit flags impacting revision behavior. The following bit offsets define:
    0: REVIDX_ISCENSORED indicates the revision has censored metadata.
    1: REVIDX_EXTSTORED indicates the revision data is stored externally.
+   12-15: REVIDX_USR[0-3] user defined flags.
 8-11 (4 bytes)
    Compressed length of revision data / chunk as stored in revlog.
 12-15 (4 bytes)
diff --git a/mercurial/revlog.py b/mercurial/revlog.py
--- a/mercurial/revlog.py
+++ b/mercurial/revlog.py
@@ -55,12 +55,21 @@
 # revlog index flags
 REVIDX_ISCENSORED = (1 << 15) # revision has censor metadata, must be verified
 REVIDX_EXTSTORED = (1 << 14) # revision data is stored externally
+REVIDX_USR0 = (1 << 3)
+REVIDX_USR1 = (1 << 2)
+REVIDX_USR2 = (1 << 1)
+REVIDX_USR3 = 1
 REVIDX_DEFAULT_FLAGS = 0
 REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED
+REVIDX_KNOWN_FLAGS |= REVIDX_USR0 | REVIDX_USR1 | REVIDX_USR2 | REVIDX_USR3
 # stable order in which flags need to be processed and their transforms applied
 REVIDX_FLAGS_ORDER = [
     REVIDX_ISCENSORED,
     REVIDX_EXTSTORED,
+    REVIDX_USR0,
+    REVIDX_USR1,
+    REVIDX_USR2,
+    REVIDX_USR3,
 ]
 
 # max size of revlog with inline data


More information about the Mercurial-devel mailing list