Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/revlog/manifest.rs @ 47969: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 | 6f579618ea7b |
children | 10c32e1b892a |
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/manifest.rs Tue Sep 14 18:10:35 2021 +0200 +++ b/rust/hg-core/src/revlog/manifest.rs Tue Sep 14 18:25:51 2021 +0200 @@ -18,14 +18,31 @@ Ok(Self { revlog }) } - /// Return the `ManifestEntry` of a given node id. - pub fn get_node(&self, node: NodePrefix) -> Result<Manifest, RevlogError> { + /// Return the `Manifest` for the given node ID. + /// + /// Note: this is a node ID in the manifestlog, typically found through + /// `ChangelogEntry::manifest_node`. It is *not* the node ID of any + /// changeset. + /// + /// See also `Repo::manifest_for_node` + pub fn data_for_node( + &self, + node: NodePrefix, + ) -> Result<Manifest, RevlogError> { let rev = self.revlog.rev_from_node(node)?; - self.get_rev(rev) + self.data_for_rev(rev) } - /// Return the `ManifestEntry` of a given node revision. - pub fn get_rev(&self, rev: Revision) -> Result<Manifest, RevlogError> { + /// Return the `Manifest` of a given revision number. + /// + /// Note: this is a revision number in the manifestlog, *not* of any + /// changeset. + /// + /// See also `Repo::manifest_for_rev` + pub fn data_for_rev( + &self, + rev: Revision, + ) -> Result<Manifest, RevlogError> { let bytes = self.revlog.get_rev_data(rev)?; Ok(Manifest { bytes }) }