Patchwork [1,of,4,censor,RFC] revlog: define censored flag for revlogng index

login
register
mail settings
Submitter adgar@google.com
Date Jan. 12, 2015, 9:08 p.m.
Message ID <22f0383cb0d3429e36fa.1421096897@adgar.nyc.corp.google.com>
Download mbox | patch
Permalink /patch/7442/
State Accepted
Commit 4f23081c901e0f96d9b165632cccdf943ec729f5
Headers show

Comments

adgar@google.com - Jan. 12, 2015, 9:08 p.m.
# HG changeset patch
# User Mike Edgar <adgar@google.com>
# Date 1421089312 18000
#      Mon Jan 12 14:01:52 2015 -0500
# Node ID 22f0383cb0d3429e36faa852b314c4fc1dfbecfb
# Parent  678f53865c6860a950392691814766957ee89316
revlog: define censored flag for revlogng index

This flag bit will be used to cheaply signal censorship presence to upper
layers (exchange, verify). It indicates that censorship metadata is present
but does not attest to the verifiability of that metadata.

For the censorship design, see: http://mercurial.selenic.com/wiki/CensorPlan

Patch

diff -r 678f53865c68 -r 22f0383cb0d3 mercurial/revlog.py
--- a/mercurial/revlog.py	Thu Jan 08 00:01:03 2015 +0100
+++ b/mercurial/revlog.py	Mon Jan 12 14:01:52 2015 -0500
@@ -34,7 +34,9 @@ 
 REVLOGNG_FLAGS = REVLOGNGINLINEDATA | REVLOGGENERALDELTA
 
 # revlog index flags
-REVIDX_KNOWN_FLAGS = 0
+REVIDX_ISCENSORED = (1 << 15) # revision has censor metadata, must be verified
+REVIDX_DEFAULT_FLAGS = 0
+REVIDX_KNOWN_FLAGS = REVIDX_ISCENSORED
 
 # max size of revlog with inline data
 _maxinline = 131072