diff rust/hg-cpython/src/dirstate/dirstate_map.rs @ 47524:69a463a4f193

dirstate: no longer pass the `oldstate` value to the dirstatemap The dirstatemap already have this information. Differential Revision: https://phab.mercurial-scm.org/D10966
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sat, 03 Jul 2021 20:59:26 +0200
parents abed645b8e96
children fe4641cf9b72
line wrap: on
line diff
--- a/rust/hg-cpython/src/dirstate/dirstate_map.rs	Sat Jul 03 20:57:44 2021 +0200
+++ b/rust/hg-cpython/src/dirstate/dirstate_map.rs	Sat Jul 03 20:59:26 2021 +0200
@@ -108,7 +108,6 @@
     def addfile(
         &self,
         f: PyObject,
-        oldstate: PyObject,
         state: PyObject,
         mode: PyObject,
         size: PyObject,
@@ -118,11 +117,6 @@
     ) -> PyResult<PyObject> {
         let f = f.extract::<PyBytes>(py)?;
         let filename = HgPath::new(f.data(py));
-        let oldstate = oldstate.extract::<PyBytes>(py)?.data(py)[0]
-            .try_into()
-            .map_err(|e: HgError| {
-                PyErr::new::<exc::ValueError, _>(py, e.to_string())
-            })?;
         let state = state.extract::<PyBytes>(py)?.data(py)[0]
             .try_into()
             .map_err(|e: HgError| {
@@ -151,7 +145,6 @@
         let possibly_dirty = possibly_dirty.extract::<PyBool>(py)?.is_true();
         self.inner(py).borrow_mut().add_file(
             filename,
-            oldstate,
             entry,
             from_p2,
             possibly_dirty