comparison rust/hg-core/src/dirstate/dirstate_map.rs @ 48050:2ac0e6b23222

dirstate: Replace dropfile with drop_item_and_copy_source Those removing a DirstateItem and a copy source are always done together Differential Revision: https://phab.mercurial-scm.org/D11493
author Simon Sapin <simon.sapin@octobus.net>
date Thu, 23 Sep 2021 15:36:43 +0200
parents 76f1c76186a1
children 98c0408324e6
comparison
equal deleted inserted replaced
48049:29aa633815db 48050:2ac0e6b23222
193 Ok(()) 193 Ok(())
194 } 194 }
195 195
196 /// Remove a file from the dirstate. 196 /// Remove a file from the dirstate.
197 /// Returns `true` if the file was previously recorded. 197 /// Returns `true` if the file was previously recorded.
198 pub fn drop_file( 198 pub fn drop_entry_and_copy_source(
199 &mut self, 199 &mut self,
200 filename: &HgPath, 200 filename: &HgPath,
201 ) -> Result<(), DirstateError> { 201 ) -> Result<(), DirstateError> {
202 let old_state = self.get(filename).map(|e| e.state()); 202 let old_state = self.get(filename).map(|e| e.state());
203 let exists = self.state_map.remove(filename).is_some(); 203 let exists = self.state_map.remove(filename).is_some();
213 } 213 }
214 } 214 }
215 self.get_non_normal_other_parent_entries() 215 self.get_non_normal_other_parent_entries()
216 .0 216 .0
217 .remove(filename); 217 .remove(filename);
218
219 self.copy_map.remove(filename);
218 220
219 Ok(()) 221 Ok(())
220 } 222 }
221 223
222 pub fn clear_ambiguous_times( 224 pub fn clear_ambiguous_times(