Mercurial > hg
diff rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 48050:2ac0e6b23222
dirstate: Replace dropfile with drop_item_and_copy_source
Those removing a DirstateItem and a copy source are always done together
Differential Revision: https://phab.mercurial-scm.org/D11493
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Thu, 23 Sep 2021 15:36:43 +0200 |
parents | 76f1c76186a1 |
children | 98c0408324e6 |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs Thu Sep 23 15:29:38 2021 +0200 +++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs Thu Sep 23 15:36:43 2021 +0200 @@ -845,7 +845,10 @@ Ok(self.add_or_remove_file(filename, old_state, entry)?) } - fn drop_file(&mut self, filename: &HgPath) -> Result<(), DirstateError> { + fn drop_entry_and_copy_source( + &mut self, + filename: &HgPath, + ) -> Result<(), DirstateError> { let was_tracked = self .get(filename)? .map_or(false, |e| e.state().is_tracked()); @@ -907,7 +910,8 @@ node.data = NodeData::None } if let Some(source) = &node.copy_source { - DirstateMap::count_dropped_path(unreachable_bytes, source) + DirstateMap::count_dropped_path(unreachable_bytes, source); + node.copy_source = None } dropped = Dropped { was_tracked: node