revlog: give EXTSTORED flag value to narrowhg
authorMartin von Zweigbergk <martinvonz@google.com>
Tue, 17 Jan 2017 11:25:02 -0800
changeset 30829 08b34c3a6f74
parent 30828 0b792507ea15
child 30830 08fa3a76a080
revlog: give EXTSTORED flag value to narrowhg Narrowhg has been using "1 << 14" as its revlog flag value for a long time. We (Google) have many repos with that value in production already. When the same value was reserved for EXTSTORED, it made those repos invalid. Upgrading them will be a little painful. We should clearly have reserved the value for narrowhg a long time ago. Since the EXTSTORED flag is not yet in any release and Facebook also says they have not started using it in production, so it should be okay to change it. This patch gives the current value (1 << 14) back to narrowhg and gives a new value (1 << 13) to EXTSTORED.
mercurial/help/internals/revlogs.txt
mercurial/revlog.py
--- a/mercurial/help/internals/revlogs.txt	Tue Jan 17 11:45:10 2017 -0800
+++ b/mercurial/help/internals/revlogs.txt	Tue Jan 17 11:25:02 2017 -0800
@@ -94,7 +94,10 @@
 
    0: REVIDX_ISCENSORED revision has censor metadata, must be verified.
 
-   1: REVIDX_EXTSTORED revision data is stored externally.
+   1: REVIDX_ELLIPSIS revision hash does not match its data. Used by
+   narrowhg
+
+   2: REVIDX_EXTSTORED revision data is stored externally.
 
 8-11 (4 bytes)
    Compressed length of revision data / chunk as stored in revlog.
--- a/mercurial/revlog.py	Tue Jan 17 11:45:10 2017 -0800
+++ b/mercurial/revlog.py	Tue Jan 17 11:25:02 2017 -0800
@@ -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_ELLIPSIS = (1 << 14) # revision hash does not match data (narrowhg)
+REVIDX_EXTSTORED = (1 << 13) # revision data is stored externally
 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_KNOWN_FLAGS = util.bitsfrom(REVIDX_FLAGS_ORDER)