comparison rust/hg-core/src/dirstate_tree/dispatch.rs @ 47521:abed645b8e96

dirstate: move the handling of special case within the dirstatemap The dirstatemap is as well, if not better, suited to decided how to encode the various case. So we move the associated code in the dirstatemap `addfile` method. This means the dirstate no longer need to know about the various magic value used in the dirstate V1 format. The pain of the messy API start to be quite palpable in Rust, we should clean this up once the current large refactoring is dealt with. Differential Revision: https://phab.mercurial-scm.org/D10963
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 04 Jul 2021 20:23:19 +0200
parents eaae39894312
children 69a463a4f193
comparison
equal deleted inserted replaced
47520:5decb7a49bb6 47521:abed645b8e96
47 fn add_file( 47 fn add_file(
48 &mut self, 48 &mut self,
49 filename: &HgPath, 49 filename: &HgPath,
50 old_state: EntryState, 50 old_state: EntryState,
51 entry: DirstateEntry, 51 entry: DirstateEntry,
52 from_p2: bool,
53 possibly_dirty: bool,
52 ) -> Result<(), DirstateError>; 54 ) -> Result<(), DirstateError>;
53 55
54 /// Mark a file as "removed" (as in `hg rm`). 56 /// Mark a file as "removed" (as in `hg rm`).
55 /// 57 ///
56 /// `old_state` is the state in the entry that `get` would have returned 58 /// `old_state` is the state in the entry that `get` would have returned
285 fn add_file( 287 fn add_file(
286 &mut self, 288 &mut self,
287 filename: &HgPath, 289 filename: &HgPath,
288 old_state: EntryState, 290 old_state: EntryState,
289 entry: DirstateEntry, 291 entry: DirstateEntry,
292 from_p2: bool,
293 possibly_dirty: bool,
290 ) -> Result<(), DirstateError> { 294 ) -> Result<(), DirstateError> {
291 self.add_file(filename, old_state, entry) 295 self.add_file(filename, old_state, entry, from_p2, possibly_dirty)
292 } 296 }
293 297
294 fn remove_file( 298 fn remove_file(
295 &mut self, 299 &mut self,
296 filename: &HgPath, 300 filename: &HgPath,