Mercurial > hg
comparison rust/hg-core/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 | e5fb14a07866 |
comparison
equal
deleted
inserted
replaced
47534:e53a42dce923 | 47535:6025353c9c55 |
---|---|
203 /// Remove a file from the dirstate. | 203 /// Remove a file from the dirstate. |
204 /// Returns `true` if the file was previously recorded. | 204 /// Returns `true` if the file was previously recorded. |
205 pub fn drop_file( | 205 pub fn drop_file( |
206 &mut self, | 206 &mut self, |
207 filename: &HgPath, | 207 filename: &HgPath, |
208 old_state: EntryState, | |
209 ) -> Result<bool, DirstateError> { | 208 ) -> Result<bool, DirstateError> { |
209 let old_state = match self.get(filename) { | |
210 Some(e) => e.state, | |
211 None => EntryState::Unknown, | |
212 }; | |
210 let exists = self.state_map.remove(filename).is_some(); | 213 let exists = self.state_map.remove(filename).is_some(); |
211 | 214 |
212 if exists { | 215 if exists { |
213 if old_state != EntryState::Removed { | 216 if old_state != EntryState::Removed { |
214 if let Some(ref mut dirs) = self.dirs { | 217 if let Some(ref mut dirs) = self.dirs { |