changeset 47233:c2180093682a

revlog: determine sidedata support based on the revlog version Revlog version "2" support sidedata, previous version does not. So lets make the initialization simpler. Differential Revision: https://phab.mercurial-scm.org/D10613
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 03 May 2021 12:29:09 +0200
parents 5eb5b866e517
children 281060fbccef
files mercurial/revlog.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/revlog.py	Mon May 03 12:28:58 2021 +0200
+++ b/mercurial/revlog.py	Mon May 03 12:29:09 2021 +0200
@@ -351,6 +351,7 @@
         self._maxdeltachainspan = -1
         self._withsparseread = False
         self._sparserevlog = False
+        self.hassidedata = False
         self._srdensitythreshold = 0.50
         self._srmingapsize = 262144
 
@@ -417,7 +418,6 @@
             self._maxdeltachainspan = opts[b'maxdeltachainspan']
         if self._mmaplargeindex and b'mmapindexthreshold' in opts:
             mmapindexthreshold = opts[b'mmapindexthreshold']
-        self.hassidedata = bool(opts.get(b'side-data', False))
         self._sparserevlog = bool(opts.get(b'sparse-revlog', False))
         withsparseread = bool(opts.get(b'with-sparse-read', False))
         # sparse-revlog forces sparse-read
@@ -521,6 +521,8 @@
             self._inline = False
             # generaldelta implied by version 2 revlogs.
             self._generaldelta = True
+            # revlog-v2 has built in sidedata support
+            self.hassidedata = True
 
         else:
             msg = _(b'unknown version (%d) in revlog %s')