# HG changeset patch
# User Raphaël Gomès <rgomes@octobus.net>
# Date 1729092063 -7200
#      Wed Oct 16 17:21:03 2024 +0200
# Node ID 43e15277498ec3b797e0889d4eb8b9f6a769cf7d
# Parent  8b7123c8947bde5bf7b869caed674c9bf7e2c854
rust-update: add a config item to disable the Rust update fastpath

Explanations inline.

diff --git a/mercurial/configitems.toml b/mercurial/configitems.toml
--- a/mercurial/configitems.toml
+++ b/mercurial/configitems.toml
@@ -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
diff --git a/mercurial/merge.py b/mercurial/merge.py
--- a/mercurial/merge.py
+++ b/mercurial/merge.py
@@ -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