diff rust/hg-core/src/revlog/mod.rs @ 50975:27e773aa607d

rust: implement the `Graph` trait for all revlogs This is trivial and makes all the algorithms relying on the trait usable for more use cases.
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 10 Aug 2023 11:01:07 +0200
parents 1928b770e3e7
children 4c5f6e95df84
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/mod.rs	Thu Aug 10 11:00:34 2023 +0200
+++ b/rust/hg-core/src/revlog/mod.rs	Thu Aug 10 11:01:07 2023 +0200
@@ -182,6 +182,12 @@
     nodemap: Option<nodemap::NodeTree>,
 }
 
+impl Graph for Revlog {
+    fn parents(&self, rev: Revision) -> Result<[Revision; 2], GraphError> {
+        self.index.parents(rev)
+    }
+}
+
 impl Revlog {
     /// Open a revlog index file.
     ///