Show More
@@ -823,6 +823,30 b" impl<'on_disk> DirstateMap<'on_disk> {" | |||
|
823 | 823 | Ok(()) |
|
824 | 824 | } |
|
825 | 825 | |
|
826 | /// Sets the cached mtime for the (potential) folder at `path`. | |
|
827 | pub(super) fn set_cached_mtime( | |
|
828 | &mut self, | |
|
829 | path: &HgPath, | |
|
830 | mtime: TruncatedTimestamp, | |
|
831 | ) -> Result<(), DirstateV2ParseError> { | |
|
832 | let node = match DirstateMap::get_node_mut( | |
|
833 | self.on_disk, | |
|
834 | &mut self.unreachable_bytes, | |
|
835 | &mut self.root, | |
|
836 | path, | |
|
837 | )? { | |
|
838 | Some(node) => node, | |
|
839 | None => return Ok(()), | |
|
840 | }; | |
|
841 | match &node.data { | |
|
842 | NodeData::Entry(_) => {} // Don’t overwrite an entry | |
|
843 | NodeData::CachedDirectory { .. } | NodeData::None => { | |
|
844 | node.data = NodeData::CachedDirectory { mtime } | |
|
845 | } | |
|
846 | } | |
|
847 | Ok(()) | |
|
848 | } | |
|
849 | ||
|
826 | 850 | fn iter_nodes<'tree>( |
|
827 | 851 | &'tree self, |
|
828 | 852 | ) -> impl Iterator< |
@@ -4,7 +4,6 b' use crate::dirstate::status::StatusPath;' | |||
|
4 | 4 | use crate::dirstate_tree::dirstate_map::BorrowedPath; |
|
5 | 5 | use crate::dirstate_tree::dirstate_map::ChildNodesRef; |
|
6 | 6 | use crate::dirstate_tree::dirstate_map::DirstateMap; |
|
7 | use crate::dirstate_tree::dirstate_map::NodeData; | |
|
8 | 7 | use crate::dirstate_tree::dirstate_map::NodeRef; |
|
9 | 8 | use crate::dirstate_tree::on_disk::DirstateV2ParseError; |
|
10 | 9 | use crate::matchers::get_ignore_function; |
@@ -143,13 +142,7 b" pub fn status<'dirstate>(" | |||
|
143 | 142 | dmap.clear_cached_mtime(path)?; |
|
144 | 143 | } |
|
145 | 144 | for (path, mtime) in &new_cachable { |
|
146 |
|
|
|
147 | match &node.data { | |
|
148 | NodeData::Entry(_) => {} // Don’t overwrite an entry | |
|
149 | NodeData::CachedDirectory { .. } | NodeData::None => { | |
|
150 | node.data = NodeData::CachedDirectory { mtime: *mtime } | |
|
151 | } | |
|
152 | } | |
|
145 | dmap.set_cached_mtime(path, *mtime)?; | |
|
153 | 146 | } |
|
154 | 147 | |
|
155 | 148 | Ok((outcome, warnings)) |
General Comments 0
You need to be logged in to leave comments.
Login now