Show More
@@ -792,58 +792,66 b' where' | |||||
792 | #[cfg(not(feature = "dirstate-tree"))] |
|
792 | #[cfg(not(feature = "dirstate-tree"))] | |
793 | #[timed] |
|
793 | #[timed] | |
794 | pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) { |
|
794 | pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) { | |
795 |
results.par_extend( |
|
795 | results.par_extend( | |
796 | move |(filename, entry)| { |
|
796 | self.dmap | |
797 | let filename: &HgPath = filename; |
|
797 | .par_iter() | |
798 | let filename_as_path = match hg_path_to_path_buf(filename) { |
|
798 | .filter(|(path, _)| self.matcher.matches(path)) | |
799 | Ok(f) => f, |
|
799 | .map(move |(filename, entry)| { | |
800 | Err(_) => { |
|
800 | let filename: &HgPath = filename; | |
801 | return ( |
|
801 | let filename_as_path = match hg_path_to_path_buf(filename) | |
|
802 | { | |||
|
803 | Ok(f) => f, | |||
|
804 | Err(_) => { | |||
|
805 | return ( | |||
|
806 | Cow::Borrowed(filename), | |||
|
807 | INVALID_PATH_DISPATCH, | |||
|
808 | ) | |||
|
809 | } | |||
|
810 | }; | |||
|
811 | let meta = self | |||
|
812 | .root_dir | |||
|
813 | .join(filename_as_path) | |||
|
814 | .symlink_metadata(); | |||
|
815 | match meta { | |||
|
816 | Ok(m) | |||
|
817 | if !(m.file_type().is_file() | |||
|
818 | || m.file_type().is_symlink()) => | |||
|
819 | { | |||
|
820 | ( | |||
|
821 | Cow::Borrowed(filename), | |||
|
822 | dispatch_missing(entry.state), | |||
|
823 | ) | |||
|
824 | } | |||
|
825 | Ok(m) => ( | |||
802 | Cow::Borrowed(filename), |
|
826 | Cow::Borrowed(filename), | |
803 |
|
|
827 | dispatch_found( | |
804 |
|
|
828 | filename, | |
805 |
|
|
829 | *entry, | |
806 | }; |
|
830 | HgMetadata::from_metadata(m), | |
807 | let meta = |
|
831 | &self.dmap.copy_map, | |
808 | self.root_dir.join(filename_as_path).symlink_metadata(); |
|
832 | self.options, | |
809 |
|
|
833 | ), | |
810 |
|
|
834 | ), | |
811 |
|
|
835 | Err(e) | |
812 | || m.file_type().is_symlink()) => |
|
836 | if e.kind() == ErrorKind::NotFound | |
813 | { |
|
837 | || e.raw_os_error() == Some(20) => | |
814 |
|
|
838 | { | |
815 | Cow::Borrowed(filename), |
|
839 | // Rust does not yet have an `ErrorKind` for | |
816 | dispatch_missing(entry.state), |
|
840 | // `NotADirectory` (errno 20) | |
817 | ) |
|
841 | // It happens if the dirstate contains `foo/bar` | |
|
842 | // and foo is not a | |||
|
843 | // directory | |||
|
844 | ( | |||
|
845 | Cow::Borrowed(filename), | |||
|
846 | dispatch_missing(entry.state), | |||
|
847 | ) | |||
|
848 | } | |||
|
849 | Err(e) => { | |||
|
850 | (Cow::Borrowed(filename), dispatch_os_error(&e)) | |||
|
851 | } | |||
818 | } |
|
852 | } | |
819 |
|
|
853 | }), | |
820 | Cow::Borrowed(filename), |
|
854 | ); | |
821 | dispatch_found( |
|
|||
822 | filename, |
|
|||
823 | *entry, |
|
|||
824 | HgMetadata::from_metadata(m), |
|
|||
825 | &self.dmap.copy_map, |
|
|||
826 | self.options, |
|
|||
827 | ), |
|
|||
828 | ), |
|
|||
829 | Err(e) |
|
|||
830 | if e.kind() == ErrorKind::NotFound |
|
|||
831 | || e.raw_os_error() == Some(20) => |
|
|||
832 | { |
|
|||
833 | // Rust does not yet have an `ErrorKind` for |
|
|||
834 | // `NotADirectory` (errno 20) |
|
|||
835 | // It happens if the dirstate contains `foo/bar` |
|
|||
836 | // and foo is not a |
|
|||
837 | // directory |
|
|||
838 | ( |
|
|||
839 | Cow::Borrowed(filename), |
|
|||
840 | dispatch_missing(entry.state), |
|
|||
841 | ) |
|
|||
842 | } |
|
|||
843 | Err(e) => (Cow::Borrowed(filename), dispatch_os_error(&e)), |
|
|||
844 | } |
|
|||
845 | }, |
|
|||
846 | )); |
|
|||
847 | } |
|
855 | } | |
848 |
|
856 | |||
849 | /// Checks all files that are in the dirstate but were not found during the |
|
857 | /// Checks all files that are in the dirstate but were not found during the |
General Comments 0
You need to be logged in to leave comments.
Login now