diff rust/hg-core/src/dirstate_tree/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 ff97e793ed36
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Sun Jul 04 02:21:59 2021 +0200
+++ b/rust/hg-core/src/dirstate_tree/dirstate_map.rs	Sun Jul 04 02:28:08 2021 +0200
@@ -803,11 +803,11 @@
         Ok(self.add_or_remove_file(filename, old_state, entry)?)
     }
 
-    fn drop_file(
-        &mut self,
-        filename: &HgPath,
-        old_state: EntryState,
-    ) -> Result<bool, DirstateError> {
+    fn drop_file(&mut self, filename: &HgPath) -> Result<bool, DirstateError> {
+        let old_state = match self.get(filename)? {
+            Some(e) => e.state,
+            None => EntryState::Unknown,
+        };
         struct Dropped {
             was_tracked: bool,
             had_entry: bool,