comparison rust/hg-core/src/dirstate_tree/status.rs @ 48257:f45d35950db6

dirstate: rename a `very_likely_equal` method to `likely_equal` No need to oversell it. Differential Revision: https://phab.mercurial-scm.org/D11691
author Simon Sapin <simon.sapin@octobus.net>
date Mon, 18 Oct 2021 19:02:40 +0200
parents 15dedc0c5c35
children 269ff8978086
comparison
equal deleted inserted replaced
48256:56d037d07395 48257:f45d35950db6
198 // The dirstate contains a cached mtime for this directory, set 198 // The dirstate contains a cached mtime for this directory, set
199 // by a previous run of the `status` algorithm which found this 199 // by a previous run of the `status` algorithm which found this
200 // directory eligible for `read_dir` caching. 200 // directory eligible for `read_dir` caching.
201 if let Some(meta) = directory_metadata { 201 if let Some(meta) = directory_metadata {
202 if cached_mtime 202 if cached_mtime
203 .very_likely_equal_to_mtime_of(meta) 203 .likely_equal_to_mtime_of(meta)
204 .unwrap_or(false) 204 .unwrap_or(false)
205 { 205 {
206 // The mtime of that directory has not changed 206 // The mtime of that directory has not changed
207 // since then, which means that the results of 207 // since then, which means that the results of
208 // `read_dir` should also be unchanged. 208 // `read_dir` should also be unchanged.
469 // unlikely enough in practice. 469 // unlikely enough in practice.
470 let truncated = TruncatedTimestamp::from(directory_mtime); 470 let truncated = TruncatedTimestamp::from(directory_mtime);
471 let is_up_to_date = if let Some(cached) = 471 let is_up_to_date = if let Some(cached) =
472 dirstate_node.cached_directory_mtime()? 472 dirstate_node.cached_directory_mtime()?
473 { 473 {
474 cached.very_likely_equal(truncated) 474 cached.likely_equal(truncated)
475 } else { 475 } else {
476 false 476 false
477 }; 477 };
478 if !is_up_to_date { 478 if !is_up_to_date {
479 let hg_path = dirstate_node 479 let hg_path = dirstate_node