diff rust/hg-core/src/dirstate_tree/owning.rs @ 52057:88aa21d654e5

rust-dirstate: actually remember the identity This was an oversight that likely had no influence on anything since we have only been writing the dirstate for status. We will start writing the dirstate for more operations now, so we'll need this fixed.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 30 Sep 2024 17:43:51 +0200
parents 2cc5de261d76
children ea0467ed76aa
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/owning.rs	Wed Aug 21 09:48:14 2024 +0200
+++ b/rust/hg-core/src/dirstate_tree/owning.rs	Mon Sep 30 17:43:51 2024 +0200
@@ -15,13 +15,17 @@
 );
 
 impl OwningDirstateMap {
-    pub fn new_empty<OnDisk>(on_disk: OnDisk) -> Self
+    pub fn new_empty<OnDisk>(on_disk: OnDisk, identity: Option<u64>) -> Self
     where
         OnDisk: Deref<Target = [u8]> + Send + 'static,
     {
         let on_disk = Box::new(on_disk);
 
-        OwningDirstateMap::new(on_disk, |bytes| DirstateMap::empty(bytes))
+        OwningDirstateMap::new(on_disk, |bytes| {
+            let mut empty = DirstateMap::empty(bytes);
+            empty.identity = identity;
+            empty
+        })
     }
 
     pub fn new_v1<OnDisk>(