diff rust/hg-core/src/dirstate/status.rs @ 46890:441024b279a6

rust: Remove the compile-time 'dirstate-tree' feature flag This code has compiler errors since it is not built on CI and nobody has been working on it for some time. We (Octobus) are still pursuing status optimizations based on a tree data structure for the dirstate, but upcoming patches will use a run-time opt-in instead of compile-time, so that at least corresponding Rust code keeps compiling when other changes are made. Differential Revision: https://phab.mercurial-scm.org/D10329
author Simon Sapin <simon.sapin@octobus.net>
date Thu, 08 Apr 2021 21:46:54 +0200
parents 3c9ddb1986a9
children 787ff5d21bcd c8f62920f07a
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate/status.rs	Sun Sep 13 22:14:25 2020 -0400
+++ b/rust/hg-core/src/dirstate/status.rs	Thu Apr 08 21:46:54 2021 +0200
@@ -9,9 +9,6 @@
 //! It is currently missing a lot of functionality compared to the Python one
 //! and will only be triggered in narrow cases.
 
-#[cfg(feature = "dirstate-tree")]
-use crate::dirstate::dirstate_tree::iter::StatusShortcut;
-#[cfg(not(feature = "dirstate-tree"))]
 use crate::utils::path_auditor::PathAuditor;
 use crate::{
     dirstate::SIZE_FROM_OTHER_PARENT,
@@ -703,83 +700,6 @@
     ///
     /// This takes a mutable reference to the results to account for the
     /// `extend` in timings
-    #[cfg(feature = "dirstate-tree")]
-    #[timed]
-    pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) {
-        results.par_extend(
-            self.dmap
-                .fs_iter(self.root_dir.clone())
-                .par_bridge()
-                .filter(|(path, _)| self.matcher.matches(path))
-                .map(move |(filename, shortcut)| {
-                    let entry = match shortcut {
-                        StatusShortcut::Entry(e) => e,
-                        StatusShortcut::Dispatch(d) => {
-                            return (Cow::Owned(filename), d)
-                        }
-                    };
-                    let filename_as_path = match hg_path_to_path_buf(&filename)
-                    {
-                        Ok(f) => f,
-                        Err(_) => {
-                            return (
-                                Cow::Owned(filename),
-                                INVALID_PATH_DISPATCH,
-                            )
-                        }
-                    };
-                    let meta = self
-                        .root_dir
-                        .join(filename_as_path)
-                        .symlink_metadata();
-
-                    match meta {
-                        Ok(m)
-                            if !(m.file_type().is_file()
-                                || m.file_type().is_symlink()) =>
-                        {
-                            (
-                                Cow::Owned(filename),
-                                dispatch_missing(entry.state),
-                            )
-                        }
-                        Ok(m) => {
-                            let dispatch = dispatch_found(
-                                &filename,
-                                entry,
-                                HgMetadata::from_metadata(m),
-                                &self.dmap.copy_map,
-                                self.options,
-                            );
-                            (Cow::Owned(filename), dispatch)
-                        }
-                        Err(e)
-                            if e.kind() == ErrorKind::NotFound
-                                || e.raw_os_error() == Some(20) =>
-                        {
-                            // Rust does not yet have an `ErrorKind` for
-                            // `NotADirectory` (errno 20)
-                            // It happens if the dirstate contains `foo/bar`
-                            // and foo is not a
-                            // directory
-                            (
-                                Cow::Owned(filename),
-                                dispatch_missing(entry.state),
-                            )
-                        }
-                        Err(e) => {
-                            (Cow::Owned(filename), dispatch_os_error(&e))
-                        }
-                    }
-                }),
-        );
-    }
-
-    /// Add the files in the dirstate to the results.
-    ///
-    /// This takes a mutable reference to the results to account for the
-    /// `extend` in timings
-    #[cfg(not(feature = "dirstate-tree"))]
     #[timed]
     pub fn extend_from_dmap(&self, results: &mut Vec<DispatchedPath<'a>>) {
         results.par_extend(
@@ -850,7 +770,6 @@
     ///
     /// This takes a mutable reference to the results to account for the
     /// `extend` in timings
-    #[cfg(not(feature = "dirstate-tree"))]
     #[timed]
     pub fn handle_unknowns(&self, results: &mut Vec<DispatchedPath<'a>>) {
         let to_visit: Vec<(&HgPath, &DirstateEntry)> =