Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/dirstate/status.rs @ 43605:8210c3f46912
rust: introduce SIZE_FROM_OTHER_PARENT constant
This will clarify what `-2` meant in the codebase.
This change also merged imports in affected files for cleanup.
Differential Revision: https://phab.mercurial-scm.org/D7301
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 07 Nov 2019 11:13:31 +0100 |
parents | 51cd86735608 |
children | ce088b38f92b |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/status.rs Thu Nov 07 10:32:26 2019 +0100 +++ b/rust/hg-core/src/dirstate/status.rs Thu Nov 07 11:13:31 2019 +0100 @@ -9,9 +9,14 @@ //! It is currently missing a lot of functionality compared to the Python one //! and will only be triggered in narrow cases. -use crate::utils::files::HgMetadata; -use crate::utils::hg_path::{hg_path_to_path_buf, HgPath}; -use crate::{CopyMap, DirstateEntry, DirstateMap, EntryState}; +use crate::{ + dirstate::SIZE_FROM_OTHER_PARENT, + utils::{ + files::HgMetadata, + hg_path::{hg_path_to_path_buf, HgPath}, + }, + CopyMap, DirstateEntry, DirstateMap, EntryState, +}; use rayon::prelude::*; use std::path::Path; @@ -69,7 +74,7 @@ let mode_changed = (mode ^ st_mode as i32) & 0o100 != 0o000 && check_exec; let metadata_changed = size >= 0 && (size_changed || mode_changed); - let other_parent = size == -2; + let other_parent = size == SIZE_FROM_OTHER_PARENT; if metadata_changed || other_parent || copy_map.contains_key(filename.as_ref())