diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 47535:6025353c9c55

dirstate: no longer pass `oldstate` to the `dropfile` The `oldstate` value come literally from `_map` so we don't need to pass tha information along. Differential Revision: https://phab.mercurial-scm.org/D10978
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Jul 2021 02:28:08 +0200
parents a1745a292885
children 84391ddf4c78
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs	Sun Jul 04 02:21:59 2021 +0200
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs	Sun Jul 04 02:28:08 2021 +0200
@@ -32,7 +32,6 @@
     dirstate::SIZE_NON_NORMAL,
     dirstate_tree::dispatch::DirstateMapMethods,
     dirstate_tree::on_disk::DirstateV2ParseError,
-    errors::HgError,
     revlog::Node,
     utils::files::normalize_case,
     utils::hg_path::{HgPath, HgPathBuf},
@@ -181,16 +180,10 @@
     def dropfile(
         &self,
         f: PyObject,
-        oldstate: PyObject
     ) -> PyResult<PyBool> {
         self.inner(py).borrow_mut()
             .drop_file(
                 HgPath::new(f.extract::<PyBytes>(py)?.data(py)),
-                oldstate.extract::<PyBytes>(py)?.data(py)[0]
-                    .try_into()
-                    .map_err(|e: HgError| {
-                        PyErr::new::<exc::ValueError, _>(py, e.to_string())
-                    })?,
             )
             .and_then(|b| Ok(b.to_py_object(py)))
             .or_else(|e| {