Patchwork D11691: dirstate: rename a `very_likely_equal` method to `likely_equal`

login
register
mail settings
Submitter phabricator
Date Oct. 19, 2021, 4:37 p.m.
Message ID <differential-rev-PHID-DREV-2brdivftmcm24admv5ws-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50015/
State Superseded
Headers show

Comments

phabricator - Oct. 19, 2021, 4:37 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  No need to oversell it.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D11691

AFFECTED FILES
  rust/hg-core/src/dirstate/entry.rs
  rust/hg-core/src/dirstate_tree/status.rs

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/hg-core/src/dirstate_tree/status.rs b/rust/hg-core/src/dirstate_tree/status.rs
--- a/rust/hg-core/src/dirstate_tree/status.rs
+++ b/rust/hg-core/src/dirstate_tree/status.rs
@@ -200,7 +200,7 @@ 
                 // directory eligible for `read_dir` caching.
                 if let Some(meta) = directory_metadata {
                     if cached_mtime
-                        .very_likely_equal_to_mtime_of(meta)
+                        .likely_equal_to_mtime_of(meta)
                         .unwrap_or(false)
                     {
                         // The mtime of that directory has not changed
@@ -471,7 +471,7 @@ 
                     let is_up_to_date = if let Some(cached) =
                         dirstate_node.cached_directory_mtime()?
                     {
-                        cached.very_likely_equal(truncated)
+                        cached.likely_equal(truncated)
                     } else {
                         false
                     };
diff --git a/rust/hg-core/src/dirstate/entry.rs b/rust/hg-core/src/dirstate/entry.rs
--- a/rust/hg-core/src/dirstate/entry.rs
+++ b/rust/hg-core/src/dirstate/entry.rs
@@ -110,16 +110,16 @@ 
     /// If someone is manipulating the modification times of some files to
     /// intentionally make `hg status` return incorrect results, not truncating
     /// wouldn’t help much since they can set exactly the expected timestamp.
-    pub fn very_likely_equal(self, other: Self) -> bool {
+    pub fn likely_equal(self, other: Self) -> bool {
         self.truncated_seconds == other.truncated_seconds
             && self.nanoseconds == other.nanoseconds
     }
 
-    pub fn very_likely_equal_to_mtime_of(
+    pub fn likely_equal_to_mtime_of(
         self,
         metadata: &fs::Metadata,
     ) -> io::Result<bool> {
-        Ok(self.very_likely_equal(Self::for_mtime_of(metadata)?))
+        Ok(self.likely_equal(Self::for_mtime_of(metadata)?))
     }
 }