diff -r 95da3e99cbd8 -r 5d205e476057 rust/hg-core/src/revlog/changelog.rs --- a/rust/hg-core/src/revlog/changelog.rs Tue Apr 05 08:47:04 2022 -0700 +++ b/rust/hg-core/src/revlog/changelog.rs Tue Apr 05 12:06:32 2022 -0700 @@ -1,6 +1,6 @@ use crate::errors::HgError; use crate::repo::Repo; -use crate::revlog::revlog::{Revlog, RevlogError}; +use crate::revlog::revlog::{Revlog, RevlogEntry, RevlogError}; use crate::revlog::Revision; use crate::revlog::{Node, NodePrefix}; use crate::utils::hg_path::HgPath; @@ -30,6 +30,14 @@ self.data_for_rev(rev) } + /// Return the `RevlogEntry` of the given revision number. + pub fn entry_for_rev( + &self, + rev: Revision, + ) -> Result { + self.revlog.get_entry(rev) + } + /// Return the `ChangelogEntry` of the given revision number. pub fn data_for_rev( &self, @@ -51,6 +59,13 @@ pub fn node_from_rev(&self, rev: Revision) -> Option<&Node> { self.revlog.node_from_rev(rev) } + + pub fn rev_from_node( + &self, + node: NodePrefix, + ) -> Result { + self.revlog.rev_from_node(node) + } } /// `Changelog` entry which knows how to interpret the `changelog` data bytes.