sparse-revlog: disable sparse-revlog if config disable general-delta
authorBoris Feld <boris.feld@octobus.net>
Mon, 12 Nov 2018 01:42:03 +0100
changeset 40902 a714eee1ac28
parent 40901 597fe8d81104
child 40903 0d62c3149fb9
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
mercurial/localrepo.py
mercurial/scmutil.py
--- 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