changeset 40884:a714eee1ac28

sparse-revlog: disable sparse-revlog if config disable general-delta Sparse-revlog requires general-delta in order to work. If general-delta is explicitly disabled through configuration, we should honor that and also disabled sparse-revlog. This change will be more relevant when sparse-revlog is enabled by default. Differential Revision: https://phab.mercurial-scm.org/D5311
author Boris Feld <boris.feld@octobus.net>
date Mon, 12 Nov 2018 01:42:03 +0100
parents 597fe8d81104
children 0d62c3149fb9
files mercurial/localrepo.py mercurial/scmutil.py
diffstat 2 files changed, 4 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Nov 12 00:48:11 2018 +0100
+++ b/mercurial/localrepo.py	Mon Nov 12 01:42:03 2018 +0100
@@ -2906,11 +2906,11 @@
 
     if scmutil.gdinitconfig(ui):
         requirements.add('generaldelta')
+        # experimental config: format.sparse-revlog
+        if ui.configbool('format', 'sparse-revlog'):
+            requirements.add(SPARSEREVLOG_REQUIREMENT)
     if ui.configbool('experimental', 'treemanifest'):
         requirements.add('treemanifest')
-    # experimental config: format.sparse-revlog
-    if ui.configbool('format', 'sparse-revlog'):
-        requirements.add(SPARSEREVLOG_REQUIREMENT)
 
     revlogv2 = ui.config('experimental', 'revlogv2')
     if revlogv2 == 'enable-unstable-format-and-corrupt-my-data':
--- a/mercurial/scmutil.py	Mon Nov 12 00:48:11 2018 +0100
+++ b/mercurial/scmutil.py	Mon Nov 12 01:42:03 2018 +0100
@@ -1450,8 +1450,7 @@
     """
     # experimental config: format.generaldelta
     return (ui.configbool('format', 'generaldelta')
-            or ui.configbool('format', 'usegeneraldelta')
-            or ui.configbool('format', 'sparse-revlog'))
+            or ui.configbool('format', 'usegeneraldelta'))
 
 def gddeltaconfig(ui):
     """helper function to know if incoming delta should be optimised