diff mercurial/localrepo.py @ 52694:bbbb12632607

slow-path: add a generic "all-slow-path" option This provide a generic config to change the slow-path behavior in a future proof way. Useful for automation and conversion.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 09 Dec 2024 06:23:34 +0100
parents f19a3f1437f3
children 5c37a03ccfb3
line wrap: on
line diff
--- a/mercurial/localrepo.py	Mon Dec 09 06:23:29 2024 +0100
+++ b/mercurial/localrepo.py	Mon Dec 09 06:23:34 2024 +0100
@@ -1173,10 +1173,10 @@
         slow_path = ui.config(
             b'storage', b'revlog.persistent-nodemap.slow-path'
         )
+        if slow_path == b'default':
+            slow_path = ui.config(b'storage', b'all-slow-path')
         if slow_path not in (b'allow', b'warn', b'abort'):
-            default = ui.config_default(
-                b'storage', b'revlog.persistent-nodemap.slow-path'
-            )
+            default = ui.config_default(b'storage', b'all-slow-path')
             msg = _(
                 b'unknown value for config '
                 b'"storage.revlog.persistent-nodemap.slow-path": "%s"\n'
@@ -1206,8 +1206,10 @@
         options[b'persistent-nodemap'] = True
     if requirementsmod.DIRSTATE_V2_REQUIREMENT in requirements:
         slow_path = ui.config(b'storage', b'dirstate-v2.slow-path')
+        if slow_path == b'default':
+            slow_path = ui.config(b'storage', b'all-slow-path')
         if slow_path not in (b'allow', b'warn', b'abort'):
-            default = ui.config_default(b'storage', b'dirstate-v2.slow-path')
+            default = ui.config_default(b'storage', b'all-slow-path')
             msg = _(b'unknown value for config "dirstate-v2.slow-path": "%s"\n')
             ui.warn(msg % slow_path)
             if not ui.quiet: