comparison 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
comparison
equal deleted inserted replaced
52056:09a54892b7ee 52057:88aa21d654e5
13 dependent: DirstateMap, 13 dependent: DirstateMap,
14 } 14 }
15 ); 15 );
16 16
17 impl OwningDirstateMap { 17 impl OwningDirstateMap {
18 pub fn new_empty<OnDisk>(on_disk: OnDisk) -> Self 18 pub fn new_empty<OnDisk>(on_disk: OnDisk, identity: Option<u64>) -> Self
19 where 19 where
20 OnDisk: Deref<Target = [u8]> + Send + 'static, 20 OnDisk: Deref<Target = [u8]> + Send + 'static,
21 { 21 {
22 let on_disk = Box::new(on_disk); 22 let on_disk = Box::new(on_disk);
23 23
24 OwningDirstateMap::new(on_disk, |bytes| DirstateMap::empty(bytes)) 24 OwningDirstateMap::new(on_disk, |bytes| {
25 let mut empty = DirstateMap::empty(bytes);
26 empty.identity = identity;
27 empty
28 })
25 } 29 }
26 30
27 pub fn new_v1<OnDisk>( 31 pub fn new_v1<OnDisk>(
28 on_disk: OnDisk, 32 on_disk: OnDisk,
29 identity: Option<u64>, 33 identity: Option<u64>,