comparison rust/hg-core/src/dirstate_tree/status.rs @ 50863:264072107105

rust-status: error on non-existent files in file_set file_set here consists of the files that were explicitly specified on the command line. Erroring on them matches the behavior of Python status.
author Spencer Baugh <sbaugh@janestreet.com>
date Wed, 02 Aug 2023 10:21:18 -0400
parents 5efccea9cf38
children 76387f79befe
comparison
equal deleted inserted replaced
50862:5efccea9cf38 50863:264072107105
10 use crate::matchers::get_ignore_function; 10 use crate::matchers::get_ignore_function;
11 use crate::matchers::Matcher; 11 use crate::matchers::Matcher;
12 use crate::utils::files::get_bytes_from_os_string; 12 use crate::utils::files::get_bytes_from_os_string;
13 use crate::utils::files::get_bytes_from_path; 13 use crate::utils::files::get_bytes_from_path;
14 use crate::utils::files::get_path_from_bytes; 14 use crate::utils::files::get_path_from_bytes;
15 use crate::utils::hg_path::hg_path_to_path_buf;
15 use crate::utils::hg_path::HgPath; 16 use crate::utils::hg_path::HgPath;
16 use crate::BadMatch; 17 use crate::BadMatch;
17 use crate::BadType; 18 use crate::BadType;
18 use crate::DirstateStatus; 19 use crate::DirstateStatus;
19 use crate::HgPathCow; 20 use crate::HgPathCow;
155 file_type: FakeFileType::Directory, 156 file_type: FakeFileType::Directory,
156 }, 157 },
157 root_cached_mtime, 158 root_cached_mtime,
158 is_at_repo_root, 159 is_at_repo_root,
159 )?; 160 )?;
161 if let Some(file_set) = common.matcher.file_set() {
162 for file in file_set {
163 if !file.is_empty() && !dmap.has_node(file)? {
164 let path = hg_path_to_path_buf(file)?;
165 if let io::Result::Err(error) =
166 root_dir.join(path).symlink_metadata()
167 {
168 common.io_error(error, file)
169 }
170 }
171 }
172 }
160 let mut outcome = common.outcome.into_inner().unwrap(); 173 let mut outcome = common.outcome.into_inner().unwrap();
161 let new_cacheable = common.new_cacheable_directories.into_inner().unwrap(); 174 let new_cacheable = common.new_cacheable_directories.into_inner().unwrap();
162 let outdated = common.outdated_cached_directories.into_inner().unwrap(); 175 let outdated = common.outdated_cached_directories.into_inner().unwrap();
163 176
164 outcome.dirty = common.ignore_patterns_have_changed == Some(true) 177 outcome.dirty = common.ignore_patterns_have_changed == Some(true)