diff rust/hg-core/src/repo.rs @ 52073:a8cf6a852f11

rust-dirstate: pass dirstate tracked key from the requirements We will make use of this with the `hg update` fastpath
author Rapha?l Gom?s <rgomes@octobus.net>
date Wed, 02 Oct 2024 18:31:32 +0200
parents e1fe336c007a
children ea0467ed76aa
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs	Wed Oct 02 13:39:43 2024 +0200
+++ b/rust/hg-core/src/repo.rs	Wed Oct 02 18:31:32 2024 +0200
@@ -9,8 +9,9 @@
 use crate::lock::{try_with_lock_no_wait, LockError};
 use crate::manifest::{Manifest, Manifestlog};
 use crate::requirements::{
-    CHANGELOGV2_REQUIREMENT, GENERALDELTA_REQUIREMENT, NODEMAP_REQUIREMENT,
-    REVLOGV1_REQUIREMENT, REVLOGV2_REQUIREMENT,
+    CHANGELOGV2_REQUIREMENT, DIRSTATE_TRACKED_HINT_V1,
+    GENERALDELTA_REQUIREMENT, NODEMAP_REQUIREMENT, REVLOGV1_REQUIREMENT,
+    REVLOGV2_REQUIREMENT,
 };
 use crate::revlog::filelog::Filelog;
 use crate::revlog::RevlogError;
@@ -547,7 +548,13 @@
             _ => DirstateMapWriteMode::Auto,
         };
 
-        map.with_dmap_mut(|m| m.set_write_mode(write_mode));
+        let tracked_hint =
+            self.requirements().contains(DIRSTATE_TRACKED_HINT_V1);
+
+        map.with_dmap_mut(|m| {
+            m.set_write_mode(write_mode);
+            m.set_tracked_hint(tracked_hint);
+        });
 
         Ok(map)
     }