diff rust/hg-core/src/dirstate_tree/dirstate_map.rs @ 49121:10edc54d18f1

rust-dirstatemap: remove `set_dirstate_entry`/`set_entry` methods These methods were needed crutches before the Rust implementation caught up to Python. Calling `set_entry` (whether from Python or Rust) was dangerous since it didn't update any of the counters of the DirstateMap data structure, while having no real way of knowing when to use it "correctly" except it you were one of the 3 people who looked deep enough into the soul of this code. Differential Revision: https://phab.mercurial-scm.org/D12519
author Raphaël Gomès <rgomes@octobus.net>
date Tue, 29 Mar 2022 00:57:06 +0200
parents 3df46f3a3d6c
children afe60def963d
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Mar 29 00:53:11 2022 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Tue Mar 29 00:57:06 2022 +0200
@@ -884,17 +884,6 @@
         });
     }
 
-    pub fn set_entry(
-        &mut self,
-        filename: &HgPath,
-        entry: DirstateEntry,
-    ) -> Result<(), DirstateV2ParseError> {
-        self.with_dmap_mut(|map| {
-            map.get_or_insert(&filename)?.data = NodeData::Entry(entry);
-            Ok(())
-        })
-    }
-
     pub fn set_tracked(
         &mut self,
         filename: &HgPath,