diff rust/hg-core/src/repo.rs @ 47997:87e3f878e65f

rust: Rename get_node methods to data_for_node, get_rev to data_for_rev These are respective methods of Changelog, Manifestlog, and Filelog; three Rust structs that that wrap a Revlog struct. This rename clarifies that node IDs or revision numbers are parameters, not return values. Also reword doc-comments in Manifestlog and Filelog to separate node IDs and revision numbers that are local to a given (non-changelog) revlog from those of a changeset. Differential Revision: https://phab.mercurial-scm.org/D11416
author Simon Sapin <simon.sapin@octobus.net>
date Tue, 14 Sep 2021 18:25:51 +0200
parents 796206e74b10
children d1d9510f73f0
line wrap: on
line diff
--- a/rust/hg-core/src/repo.rs	Tue Sep 14 18:10:35 2021 +0200
+++ b/rust/hg-core/src/repo.rs	Tue Sep 14 18:25:51 2021 +0200
@@ -336,26 +336,29 @@
         self.manifestlog.get_mut_or_init(self)
     }
 
-    /// Returns the manifest of the given node ID
+    /// Returns the manifest of the *changeset* with the given node ID
     pub fn manifest_for_node(
         &self,
         node: impl Into<NodePrefix>,
     ) -> Result<Manifest, RevlogError> {
-        self.manifestlog()?.get_node(
+        self.manifestlog()?.data_for_node(
             self.changelog()?
-                .get_node(node.into())?
+                .data_for_node(node.into())?
                 .manifest_node()?
                 .into(),
         )
     }
 
-    /// Returns the manifest of the given revision
+    /// Returns the manifest of the *changeset* with the given revision number
     pub fn manifest_for_rev(
         &self,
         revision: Revision,
     ) -> Result<Manifest, RevlogError> {
-        self.manifestlog()?.get_node(
-            self.changelog()?.get_rev(revision)?.manifest_node()?.into(),
+        self.manifestlog()?.data_for_node(
+            self.changelog()?
+                .data_for_rev(revision)?
+                .manifest_node()?
+                .into(),
         )
     }