Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-core/src/repo.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 | db7dbe6f7bb2 |
children | babfa9ddca0e |
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs Wed Aug 21 09:48:14 2024 +0200 +++ b/rust/hg-core/src/repo.rs Mon Sep 30 17:43:51 2024 +0200 @@ -342,7 +342,6 @@ let identity = self.dirstate_identity()?; let dirstate = self.dirstate_file_contents()?; if dirstate.is_empty() { - self.dirstate_parents.set(DirstateParents::NULL); Ok((identity, None, 0)) } else { let docket_res = @@ -427,7 +426,7 @@ let dirstate_file_contents = self.dirstate_file_contents()?; if dirstate_file_contents.is_empty() { self.dirstate_parents.set(DirstateParents::NULL); - Ok(OwningDirstateMap::new_empty(Vec::new())) + Ok(OwningDirstateMap::new_empty(Vec::new(), identity)) } else { let (map, parents) = OwningDirstateMap::new_v1(dirstate_file_contents, identity)?; @@ -443,8 +442,7 @@ let dirstate_file_contents = self.dirstate_file_contents()?; let identity = self.dirstate_identity()?; if dirstate_file_contents.is_empty() { - self.dirstate_parents.set(DirstateParents::NULL); - return Ok(OwningDirstateMap::new_empty(Vec::new())); + return Ok(OwningDirstateMap::new_empty(Vec::new(), identity)); } let docket = crate::dirstate_tree::on_disk::read_docket( &dirstate_file_contents,