rust-update: add a config item to disable the Rust update fastpath
authorRaphaël Gomès <rgomes@octobus.net>
Wed, 16 Oct 2024 17:21:03 +0200
changeset 52061 43e15277498e
parent 52060 8b7123c8947b
child 52062 73cf8b56c2f5
rust-update: add a config item to disable the Rust update fastpath Explanations inline.
mercurial/configitems.toml
mercurial/merge.py
--- a/mercurial/configitems.toml	Tue Oct 01 13:49:11 2024 +0200
+++ b/mercurial/configitems.toml	Wed Oct 16 17:21:03 2024 +0200
@@ -1963,6 +1963,17 @@
 experimental = true
 
 [[items]]
+section = "rust"
+name = "update-from-null"
+default = true
+experimental = true
+documentation = """Whether to use the Rust fast-path when an update from null
+is detected. This config item is here to help users disable the fastpath in
+case one of their extensions is interfering with the update code. If you are
+one of these people, please reach out.
+"""
+
+[[items]]
 section = "server"
 name = "bookmarks-pushkey-compat"
 default = true
--- a/mercurial/merge.py	Tue Oct 01 13:49:11 2024 +0200
+++ b/mercurial/merge.py	Wed Oct 16 17:21:03 2024 +0200
@@ -35,7 +35,6 @@
     pathutil,
     policy,
     pycompat,
-    requirements,
     scmutil,
     subrepoutil,
     util,
@@ -2024,6 +2023,7 @@
         update_from_null_fallback = False
         if (
             MAYBE_USE_RUST_UPDATE
+            and repo.ui.configbool(b"rust", b"update-from-null")
             and rust_update_mod is not None
             and p1.rev() == nullrev
             and not branchmerge