Mercurial > hg
diff rust/hg-core/src/dirstate/dirstate_map.rs @ 46890:441024b279a6
rust: Remove the compile-time 'dirstate-tree' feature flag
This code has compiler errors since it is not built on CI and nobody has been
working on it for some time.
We (Octobus) are still pursuing status optimizations based on a tree data
structure for the dirstate, but upcoming patches will use a run-time opt-in
instead of compile-time, so that at least corresponding Rust code keeps
compiling when other changes are made.
Differential Revision: https://phab.mercurial-scm.org/D10329
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 08 Apr 2021 21:46:54 +0200 |
parents | 98a455a62699 |
children | 787ff5d21bcd |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/dirstate_map.rs Sun Sep 13 22:14:25 2020 -0400 +++ b/rust/hg-core/src/dirstate/dirstate_map.rs Thu Apr 08 21:46:54 2021 +0200 @@ -254,7 +254,6 @@ ) } - #[cfg(not(feature = "dirstate-tree"))] pub fn set_non_normal_other_parent_entries(&mut self, force: bool) { if !force && self.non_normal_set.is_some() @@ -283,34 +282,6 @@ self.non_normal_set = Some(non_normal); self.other_parent_set = Some(other_parent); } - #[cfg(feature = "dirstate-tree")] - pub fn set_non_normal_other_parent_entries(&mut self, force: bool) { - if !force - && self.non_normal_set.is_some() - && self.other_parent_set.is_some() - { - return; - } - let mut non_normal = HashSet::new(); - let mut other_parent = HashSet::new(); - - for ( - filename, - DirstateEntry { - state, size, mtime, .. - }, - ) in self.state_map.iter() - { - if state != EntryState::Normal || mtime == MTIME_UNSET { - non_normal.insert(filename.to_owned()); - } - if state == EntryState::Normal && size == SIZE_FROM_OTHER_PARENT { - other_parent.insert(filename.to_owned()); - } - } - self.non_normal_set = Some(non_normal); - self.other_parent_set = Some(other_parent); - } /// Both of these setters and their uses appear to be the simplest way to /// emulate a Python lazy property, but it is ugly and unidiomatic. @@ -426,7 +397,6 @@ self.set_non_normal_other_parent_entries(true); Ok(packed) } - #[cfg(not(feature = "dirstate-tree"))] pub fn build_file_fold_map(&mut self) -> &FileFoldMap { if let Some(ref file_fold_map) = self.file_fold_map { return file_fold_map; @@ -442,22 +412,6 @@ self.file_fold_map = Some(new_file_fold_map); self.file_fold_map.as_ref().unwrap() } - #[cfg(feature = "dirstate-tree")] - pub fn build_file_fold_map(&mut self) -> &FileFoldMap { - if let Some(ref file_fold_map) = self.file_fold_map { - return file_fold_map; - } - let mut new_file_fold_map = FileFoldMap::default(); - - for (filename, DirstateEntry { state, .. }) in self.state_map.iter() { - if state != EntryState::Removed { - new_file_fold_map - .insert(normalize_case(&filename), filename.to_owned()); - } - } - self.file_fold_map = Some(new_file_fold_map); - self.file_fold_map.as_ref().unwrap() - } } #[cfg(test)]