diff mercurial/revlog.py @ 47274:6c84fc9c9a90

changelogv2: introduce a "changelogv2" feature Right now, this means using revlogv2, but only for the changelog. We will have the format more unique in future changesets. Differential Revision: https://phab.mercurial-scm.org/D10660
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 29 Mar 2021 22:40:54 +0200
parents 80164d50ae3d
children 921648d31553
line wrap: on
line diff
--- a/mercurial/revlog.py	Tue May 04 05:18:57 2021 +0200
+++ b/mercurial/revlog.py	Mon Mar 29 22:40:54 2021 +0200
@@ -42,6 +42,7 @@
     FLAG_GENERALDELTA,
     FLAG_INLINE_DATA,
     INDEX_HEADER,
+    KIND_CHANGELOG,
     REVLOGV0,
     REVLOGV1,
     REVLOGV1_FLAGS,
@@ -458,7 +459,9 @@
         mmapindexthreshold = None
         opts = self.opener.options
 
-        if b'revlogv2' in opts:
+        if b'changelogv2' in opts and self.revlog_kind == KIND_CHANGELOG:
+            new_header = REVLOGV2
+        elif b'revlogv2' in opts:
             new_header = REVLOGV2
         elif b'revlogv1' in opts:
             new_header = REVLOGV1 | FLAG_INLINE_DATA