Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/dirstate_tree/owning.rs @ 52050:ea0467ed76aa
rust-dirstate-map: use a more precise identity
This is closer to the behavior of what Python does. So far, we were checking
only the inode, but this might not be good enough for the v1 case.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 03 Oct 2024 16:35:31 +0200 |
parents | 88aa21d654e5 |
children |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/owning.rs Mon Oct 14 14:14:21 2024 +0200 +++ b/rust/hg-core/src/dirstate_tree/owning.rs Thu Oct 03 16:35:31 2024 +0200 @@ -1,6 +1,6 @@ use crate::{DirstateError, DirstateParents}; -use super::dirstate_map::DirstateMap; +use super::dirstate_map::{DirstateIdentity, DirstateMap}; use self_cell::self_cell; use std::ops::Deref; @@ -15,7 +15,10 @@ ); impl OwningDirstateMap { - pub fn new_empty<OnDisk>(on_disk: OnDisk, identity: Option<u64>) -> Self + pub fn new_empty<OnDisk>( + on_disk: OnDisk, + identity: Option<DirstateIdentity>, + ) -> Self where OnDisk: Deref<Target = [u8]> + Send + 'static, { @@ -30,7 +33,7 @@ pub fn new_v1<OnDisk>( on_disk: OnDisk, - identity: Option<u64>, + identity: Option<DirstateIdentity>, ) -> Result<(Self, DirstateParents), DirstateError> where OnDisk: Deref<Target = [u8]> + Send + 'static, @@ -54,7 +57,7 @@ data_size: usize, metadata: &[u8], uuid: Vec<u8>, - identity: Option<u64>, + identity: Option<DirstateIdentity>, ) -> Result<Self, DirstateError> where OnDisk: Deref<Target = [u8]> + Send + 'static, @@ -85,7 +88,7 @@ self.get_map().old_uuid.as_deref() } - pub fn old_identity(&self) -> Option<u64> { + pub fn old_identity(&self) -> Option<DirstateIdentity> { self.get_map().identity }