##// END OF EJS Templates
rust-status: honor matcher when using the dirstate-only fast-path (issue6483)...
Raphaël Gomès -
r47218:fb6eca7b stable
parent child Browse files
Show More
@@ -792,58 +792,66 b' where'
792 792 #[cfg(not(feature = "dirstate-tree"))]
793 793 #[timed]
794 794 pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) {
795 results.par_extend(self.dmap.par_iter().map(
796 move |(filename, entry)| {
797 let filename: &HgPath = filename;
798 let filename_as_path = match hg_path_to_path_buf(filename) {
799 Ok(f) => f,
800 Err(_) => {
801 return (
795 results.par_extend(
796 self.dmap
797 .par_iter()
798 .filter(|(path, _)| self.matcher.matches(path))
799 .map(move |(filename, entry)| {
800 let filename: &HgPath = filename;
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 826 Cow::Borrowed(filename),
803 INVALID_PATH_DISPATCH,
804 )
805 }
806 };
807 let meta =
808 self.root_dir.join(filename_as_path).symlink_metadata();
809 match meta {
810 Ok(m)
811 if !(m.file_type().is_file()
812 || m.file_type().is_symlink()) =>
813 {
814 (
815 Cow::Borrowed(filename),
816 dispatch_missing(entry.state),
817 )
827 dispatch_found(
828 filename,
829 *entry,
830 HgMetadata::from_metadata(m),
831 &self.dmap.copy_map,
832 self.options,
833 ),
834 ),
835 Err(e)
836 if e.kind() == ErrorKind::NotFound
837 || e.raw_os_error() == Some(20) =>
838 {
839 // Rust does not yet have an `ErrorKind` for
840 // `NotADirectory` (errno 20)
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 Ok(m) => (
820 Cow::Borrowed(filename),
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 ));
853 }),
854 );
847 855 }
848 856
849 857 /// Checks all files that are in the dirstate but were not found during the
@@ -691,4 +691,3 b' the working directory (issue6483)'
691 691 $ hg add a.py b.rs
692 692 $ hg st -aI "*.py"
693 693 A a.py
694 A b.rs (known-bad-output rust !)
General Comments 0
You need to be logged in to leave comments. Login now