# HG changeset patch # User Raphaël Gomès # Date 1648508226 -7200 # Node ID 10edc54d18f11d2e7c9612553d1e1149b65918bc # Parent 3df46f3a3d6c2c1253944d6100a216eddd97ee48 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 diff -r 3df46f3a3d6c -r 10edc54d18f1 rust/hg-core/src/dirstate_tree/dirstate_map.rs --- 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, diff -r 3df46f3a3d6c -r 10edc54d18f1 rust/hg-cpython/src/dirstate/dirstate_map.rs --- a/rust/hg-cpython/src/dirstate/dirstate_map.rs Tue Mar 29 00:53:11 2022 +0200 +++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs Tue Mar 29 00:57:06 2022 +0200 @@ -104,20 +104,6 @@ } } - def set_dirstate_item( - &self, - path: PyObject, - item: DirstateItem - ) -> PyResult { - let f = path.extract::(py)?; - let filename = HgPath::new(f.data(py)); - self.inner(py) - .borrow_mut() - .set_entry(filename, item.get_entry(py)) - .map_err(|e| v2_error(py, e))?; - Ok(py.None()) - } - def set_tracked(&self, f: PyObject) -> PyResult { let bytes = f.extract::(py)?; let path = HgPath::new(bytes.data(py));