rust-repo: add a method to get a `Node` from a `Revision` to the `Repo`
This is going to be more and more useful as we start writing higher-level code
--- a/rust/hg-core/src/repo.rs Mon Sep 30 17:45:10 2024 +0200
+++ b/rust/hg-core/src/repo.rs Mon Sep 30 17:46:24 2024 +0200
@@ -797,6 +797,12 @@
)?,
})
}
+
+ pub fn node(&self, rev: UncheckedRevision) -> Option<crate::Node> {
+ self.changelog()
+ .ok()
+ .and_then(|c| c.node_from_rev(rev).copied())
+ }
}
/// Lazily-initialized component of `Repo` with interior mutability