# HG changeset patch # User Simon Sapin # Date 1631635835 -7200 # Node ID 6f579618ea7be1f1a310a65e659f9dbfef4a3230 # Parent 6c653d9d41b851ac0997ac537e1b51a3ef69cf1b rust: Rename the `Revlog::get_node_rev` method to `rev_from_node` This better describes the input and outputs of this method. Also rewrite the doc-comment, which seemed to have been left from copy-paste of another method. Differential Revision: https://phab.mercurial-scm.org/D11415 diff -r 6c653d9d41b8 -r 6f579618ea7b rust/hg-core/src/revlog/changelog.rs --- a/rust/hg-core/src/revlog/changelog.rs Tue Sep 14 18:07:11 2021 +0200 +++ b/rust/hg-core/src/revlog/changelog.rs Tue Sep 14 18:10:35 2021 +0200 @@ -22,7 +22,7 @@ &self, node: NodePrefix, ) -> Result { - let rev = self.revlog.get_node_rev(node)?; + let rev = self.revlog.rev_from_node(node)?; self.get_rev(rev) } diff -r 6c653d9d41b8 -r 6f579618ea7b rust/hg-core/src/revlog/filelog.rs --- a/rust/hg-core/src/revlog/filelog.rs Tue Sep 14 18:07:11 2021 +0200 +++ b/rust/hg-core/src/revlog/filelog.rs Tue Sep 14 18:10:35 2021 +0200 @@ -30,7 +30,7 @@ &self, file_node: impl Into, ) -> Result { - let file_rev = self.revlog.get_node_rev(file_node.into())?; + let file_rev = self.revlog.rev_from_node(file_node.into())?; self.get_rev(file_rev) } diff -r 6c653d9d41b8 -r 6f579618ea7b rust/hg-core/src/revlog/manifest.rs --- a/rust/hg-core/src/revlog/manifest.rs Tue Sep 14 18:07:11 2021 +0200 +++ b/rust/hg-core/src/revlog/manifest.rs Tue Sep 14 18:10:35 2021 +0200 @@ -20,7 +20,7 @@ /// Return the `ManifestEntry` of a given node id. pub fn get_node(&self, node: NodePrefix) -> Result { - let rev = self.revlog.get_node_rev(node)?; + let rev = self.revlog.rev_from_node(node)?; self.get_rev(rev) } diff -r 6c653d9d41b8 -r 6f579618ea7b rust/hg-core/src/revlog/revlog.rs --- a/rust/hg-core/src/revlog/revlog.rs Tue Sep 14 18:07:11 2021 +0200 +++ b/rust/hg-core/src/revlog/revlog.rs Tue Sep 14 18:10:35 2021 +0200 @@ -124,9 +124,9 @@ Some(self.index.get_entry(rev)?.hash()) } - /// Return the full data associated to a node. + /// Return the revision number for the given node ID, if it exists in this revlog #[timed] - pub fn get_node_rev( + pub fn rev_from_node( &self, node: NodePrefix, ) -> Result { diff -r 6c653d9d41b8 -r 6f579618ea7b rust/hg-core/src/revset.rs --- a/rust/hg-core/src/revset.rs Tue Sep 14 18:07:11 2021 +0200 +++ b/rust/hg-core/src/revset.rs Tue Sep 14 18:10:35 2021 +0200 @@ -61,7 +61,7 @@ { return Err(RevlogError::WDirUnsupported); } - return revlog.get_node_rev(prefix); + return revlog.rev_from_node(prefix); } Err(RevlogError::InvalidRevision) }