##// END OF EJS Templates
rust-status: fix typos and add docstrings to dircache related fields
Raphaël Gomès -
r50449:ecf9788c stable
parent child Browse files
Show More
@@ -121,8 +121,8 b" pub fn status<'dirstate>("
121 ignore_fn,
121 ignore_fn,
122 outcome: Mutex::new(outcome),
122 outcome: Mutex::new(outcome),
123 ignore_patterns_have_changed: patterns_changed,
123 ignore_patterns_have_changed: patterns_changed,
124 new_cachable_directories: Default::default(),
124 new_cacheable_directories: Default::default(),
125 outated_cached_directories: Default::default(),
125 outdated_cached_directories: Default::default(),
126 filesystem_time_at_status_start,
126 filesystem_time_at_status_start,
127 };
127 };
128 let is_at_repo_root = true;
128 let is_at_repo_root = true;
@@ -143,12 +143,12 b" pub fn status<'dirstate>("
143 is_at_repo_root,
143 is_at_repo_root,
144 )?;
144 )?;
145 let mut outcome = common.outcome.into_inner().unwrap();
145 let mut outcome = common.outcome.into_inner().unwrap();
146 let new_cachable = common.new_cachable_directories.into_inner().unwrap();
146 let new_cacheable = common.new_cacheable_directories.into_inner().unwrap();
147 let outdated = common.outated_cached_directories.into_inner().unwrap();
147 let outdated = common.outdated_cached_directories.into_inner().unwrap();
148
148
149 outcome.dirty = common.ignore_patterns_have_changed == Some(true)
149 outcome.dirty = common.ignore_patterns_have_changed == Some(true)
150 || !outdated.is_empty()
150 || !outdated.is_empty()
151 || (!new_cachable.is_empty()
151 || (!new_cacheable.is_empty()
152 && dmap.dirstate_version == DirstateVersion::V2);
152 && dmap.dirstate_version == DirstateVersion::V2);
153
153
154 // Remove outdated mtimes before adding new mtimes, in case a given
154 // Remove outdated mtimes before adding new mtimes, in case a given
@@ -156,7 +156,7 b" pub fn status<'dirstate>("
156 for path in &outdated {
156 for path in &outdated {
157 dmap.clear_cached_mtime(path)?;
157 dmap.clear_cached_mtime(path)?;
158 }
158 }
159 for (path, mtime) in &new_cachable {
159 for (path, mtime) in &new_cacheable {
160 dmap.set_cached_mtime(path, *mtime)?;
160 dmap.set_cached_mtime(path, *mtime)?;
161 }
161 }
162
162
@@ -171,9 +171,11 b" struct StatusCommon<'a, 'tree, 'on_disk:"
171 matcher: &'a (dyn Matcher + Sync),
171 matcher: &'a (dyn Matcher + Sync),
172 ignore_fn: IgnoreFnType<'a>,
172 ignore_fn: IgnoreFnType<'a>,
173 outcome: Mutex<DirstateStatus<'on_disk>>,
173 outcome: Mutex<DirstateStatus<'on_disk>>,
174 new_cachable_directories:
174 /// New timestamps of directories to be used for caching their readdirs
175 new_cacheable_directories:
175 Mutex<Vec<(Cow<'on_disk, HgPath>, TruncatedTimestamp)>>,
176 Mutex<Vec<(Cow<'on_disk, HgPath>, TruncatedTimestamp)>>,
176 outated_cached_directories: Mutex<Vec<Cow<'on_disk, HgPath>>>,
177 /// Used to invalidate the readdir cache of directories
178 outdated_cached_directories: Mutex<Vec<Cow<'on_disk, HgPath>>>,
177
179
178 /// Whether ignore files like `.hgignore` have changed since the previous
180 /// Whether ignore files like `.hgignore` have changed since the previous
179 /// time a `status()` call wrote their hash to the dirstate. `None` means
181 /// time a `status()` call wrote their hash to the dirstate. `None` means
@@ -305,7 +307,7 b" impl<'a, 'tree, 'on_disk> StatusCommon<'"
305 if self.ignore_patterns_have_changed == Some(true)
307 if self.ignore_patterns_have_changed == Some(true)
306 && dirstate_node.cached_directory_mtime()?.is_some()
308 && dirstate_node.cached_directory_mtime()?.is_some()
307 {
309 {
308 self.outated_cached_directories.lock().unwrap().push(
310 self.outdated_cached_directories.lock().unwrap().push(
309 dirstate_node
311 dirstate_node
310 .full_path_borrowed(self.dmap.on_disk)?
312 .full_path_borrowed(self.dmap.on_disk)?
311 .detach_from_tree(),
313 .detach_from_tree(),
@@ -629,7 +631,7 b" impl<'a, 'tree, 'on_disk> StatusCommon<'"
629 let hg_path = dirstate_node
631 let hg_path = dirstate_node
630 .full_path_borrowed(self.dmap.on_disk)?
632 .full_path_borrowed(self.dmap.on_disk)?
631 .detach_from_tree();
633 .detach_from_tree();
632 self.new_cachable_directories
634 self.new_cacheable_directories
633 .lock()
635 .lock()
634 .unwrap()
636 .unwrap()
635 .push((hg_path, directory_mtime))
637 .push((hg_path, directory_mtime))
General Comments 0
You need to be logged in to leave comments. Login now