--- a/rust/hg-core/src/revlog/changelog.rs Mon Mar 08 19:07:29 2021 +0100
+++ b/rust/hg-core/src/revlog/changelog.rs Wed Mar 03 16:40:03 2021 +0100
@@ -1,8 +1,8 @@
use crate::errors::HgError;
use crate::repo::Repo;
use crate::revlog::revlog::{Revlog, RevlogError};
-use crate::revlog::NodePrefix;
use crate::revlog::Revision;
+use crate::revlog::{Node, NodePrefix};
/// A specialized `Revlog` to work with `changelog` data format.
pub struct Changelog {
@@ -34,6 +34,10 @@
let bytes = self.revlog.get_rev_data(rev)?;
Ok(ChangelogEntry { bytes })
}
+
+ pub fn node_from_rev(&self, rev: Revision) -> Option<&Node> {
+ Some(self.revlog.index.get_entry(rev)?.hash())
+ }
}
/// `Changelog` entry which knows how to interpret the `changelog` data bytes.