equal
deleted
inserted
replaced
26 use hg::utils::debug::debug_wait_for_file; |
26 use hg::utils::debug::debug_wait_for_file; |
27 use hg::utils::files::{ |
27 use hg::utils::files::{ |
28 get_bytes_from_os_str, get_bytes_from_os_string, get_path_from_bytes, |
28 get_bytes_from_os_str, get_bytes_from_os_string, get_path_from_bytes, |
29 }; |
29 }; |
30 use hg::utils::hg_path::{hg_path_to_path_buf, HgPath}; |
30 use hg::utils::hg_path::{hg_path_to_path_buf, HgPath}; |
31 use hg::DirstateStatus; |
|
32 use hg::PatternFileWarning; |
31 use hg::PatternFileWarning; |
33 use hg::Revision; |
32 use hg::Revision; |
34 use hg::StatusError; |
33 use hg::StatusError; |
35 use hg::StatusOptions; |
34 use hg::StatusOptions; |
36 use hg::{self, narrow, sparse}; |
35 use hg::{self, narrow, sparse}; |
|
36 use hg::{DirstateStatus, RevlogOpenOptions}; |
37 use log::info; |
37 use log::info; |
38 use rayon::prelude::*; |
38 use rayon::prelude::*; |
39 use std::borrow::Cow; |
39 use std::borrow::Cow; |
40 use std::io; |
40 use std::io; |
41 use std::mem::take; |
41 use std::mem::take; |
381 let manifest = repo.manifest_for_node(p1).map_err(|e| { |
381 let manifest = repo.manifest_for_node(p1).map_err(|e| { |
382 CommandError::from((e, &*format!("{:x}", p1.short()))) |
382 CommandError::from((e, &*format!("{:x}", p1.short()))) |
383 })?; |
383 })?; |
384 let working_directory_vfs = repo.working_directory_vfs(); |
384 let working_directory_vfs = repo.working_directory_vfs(); |
385 let store_vfs = repo.store_vfs(); |
385 let store_vfs = repo.store_vfs(); |
|
386 let revlog_open_options = repo.default_revlog_options(false)?; |
386 let res: Vec<_> = take(&mut ds_status.unsure) |
387 let res: Vec<_> = take(&mut ds_status.unsure) |
387 .into_par_iter() |
388 .into_par_iter() |
388 .map(|to_check| { |
389 .map(|to_check| { |
389 // The compiler seems to get a bit confused with complex |
390 // The compiler seems to get a bit confused with complex |
390 // inference when using a parallel iterator + map |
391 // inference when using a parallel iterator + map |
394 working_directory_vfs, |
395 working_directory_vfs, |
395 store_vfs, |
396 store_vfs, |
396 check_exec, |
397 check_exec, |
397 &manifest, |
398 &manifest, |
398 &to_check.path, |
399 &to_check.path, |
|
400 revlog_open_options, |
399 ) { |
401 ) { |
400 Err(HgError::IoError { .. }) => { |
402 Err(HgError::IoError { .. }) => { |
401 // IO errors most likely stem from the file being |
403 // IO errors most likely stem from the file being |
402 // deleted even though we know it's in the |
404 // deleted even though we know it's in the |
403 // dirstate. |
405 // dirstate. |
745 working_directory_vfs: hg::vfs::Vfs, |
747 working_directory_vfs: hg::vfs::Vfs, |
746 store_vfs: hg::vfs::Vfs, |
748 store_vfs: hg::vfs::Vfs, |
747 check_exec: bool, |
749 check_exec: bool, |
748 manifest: &Manifest, |
750 manifest: &Manifest, |
749 hg_path: &HgPath, |
751 hg_path: &HgPath, |
|
752 revlog_open_options: RevlogOpenOptions, |
750 ) -> Result<UnsureOutcome, HgError> { |
753 ) -> Result<UnsureOutcome, HgError> { |
751 let vfs = working_directory_vfs; |
754 let vfs = working_directory_vfs; |
752 let fs_path = hg_path_to_path_buf(hg_path).expect("HgPath conversion"); |
755 let fs_path = hg_path_to_path_buf(hg_path).expect("HgPath conversion"); |
753 let fs_metadata = vfs.symlink_metadata(&fs_path)?; |
756 let fs_metadata = vfs.symlink_metadata(&fs_path)?; |
754 let is_symlink = fs_metadata.file_type().is_symlink(); |
757 let is_symlink = fs_metadata.file_type().is_symlink(); |
776 }; |
779 }; |
777 |
780 |
778 if entry_flags != fs_flags { |
781 if entry_flags != fs_flags { |
779 return Ok(UnsureOutcome::Modified); |
782 return Ok(UnsureOutcome::Modified); |
780 } |
783 } |
781 let filelog = hg::filelog::Filelog::open_vfs(&store_vfs, hg_path)?; |
784 let filelog = hg::filelog::Filelog::open_vfs( |
|
785 &store_vfs, |
|
786 hg_path, |
|
787 revlog_open_options, |
|
788 )?; |
782 let fs_len = fs_metadata.len(); |
789 let fs_len = fs_metadata.len(); |
783 let file_node = entry.node_id()?; |
790 let file_node = entry.node_id()?; |
784 let filelog_entry = filelog.entry_for_node(file_node).map_err(|_| { |
791 let filelog_entry = filelog.entry_for_node(file_node).map_err(|_| { |
785 HgError::corrupted(format!( |
792 HgError::corrupted(format!( |
786 "filelog {:?} missing node {:?} from manifest", |
793 "filelog {:?} missing node {:?} from manifest", |