Patchwork [5,of,5,flagprocessor,v6] revlog: REVIDX_EXTSTORED flag

login
register
mail settings
Submitter Remi Chaintron
Date Dec. 24, 2016, 4:36 p.m.
Message ID <e2fa519223e1b15ec969.1482597391@remi-mbp2>
Download mbox | patch
Permalink /patch/18026/
State Changes Requested
Delegated to: Pierre-Yves David
Headers show

Comments

Remi Chaintron - Dec. 24, 2016, 4:36 p.m.
# HG changeset patch
# User Remi Chaintron <remi@fb.com>
# Date 1482451803 18000
#      Thu Dec 22 19:10:03 2016 -0500
# Node ID e2fa519223e1b15ec969464e7879d7d54b9488bb
# Parent  c94d2907a470ca03b4a4a8da514b66d2f8952bce
revlog: REVIDX_EXTSTORED flag
Augie Fackler - Dec. 24, 2016, 8:07 p.m.
On Sat, Dec 24, 2016 at 11:36:31AM -0500, Remi Chaintron wrote:
> # HG changeset patch
> # User Remi Chaintron <remi@fb.com>
> # Date 1482451803 18000
> #      Thu Dec 22 19:10:03 2016 -0500
> # Node ID e2fa519223e1b15ec969464e7879d7d54b9488bb
> # Parent  c94d2907a470ca03b4a4a8da514b66d2f8952bce
> revlog: REVIDX_EXTSTORED flag

This series looks like a good, minimal[0] API that should let us
eventually clean up censor and should let LFS make good forward
progress. Strong +1.

0: I mean this as praise - it's the smallest API I can envision that
solves the problem, which is a Good Thing.

>
> 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
> @@ -90,6 +90,7 @@
>  6-7 (2 bytes)
>     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.
>  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
> @@ -54,11 +54,13 @@
>
>  # revlog index flags
>  REVIDX_ISCENSORED = (1 << 15) # revision has censor metadata, must be verified
> +REVIDX_EXTSTORED = (1 << 14) # revision data is stored externally
>  REVIDX_DEFAULT_FLAGS = 0
> -REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED
> +REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED
>  # stable order in which flags need to be processed and their transforms applied
>  REVIDX_FLAGS_ORDER = [
>      REVIDX_ISCENSORED,
> +    REVIDX_EXTSTORED,
>  ]
>
>  # max size of revlog with inline data
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

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

@@ -90,6 +90,7 @@ 

 6-7 (2 bytes)
    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.

 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

@@ -54,11 +54,13 @@ 

 
 # revlog index flags
 REVIDX_ISCENSORED = (1 << 15) # revision has censor metadata, must be verified
+REVIDX_EXTSTORED = (1 << 14) # revision data is stored externally

 REVIDX_DEFAULT_FLAGS = 0
-REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED

+REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED | REVIDX_EXTSTORED

 # stable order in which flags need to be processed and their transforms applied
 REVIDX_FLAGS_ORDER = [
     REVIDX_ISCENSORED,
+    REVIDX_EXTSTORED,

 ]
 
 # max size of revlog with inline data