changeset 52801:419e60ff3c44

rust-pyo3-revlog: _index_commonancestorsheads Very straightforward, now.
author Georges Racinet <georges.racinet@cloudcrane.io>
date Mon, 23 Dec 2024 21:30:02 +0100
parents ebcbd2b7a3b6
children 8cb1a561c5ac
files rust/hg-pyo3/src/revlog/mod.rs
diffstat 1 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-pyo3/src/revlog/mod.rs	Mon Dec 23 21:03:38 2024 +0100
+++ b/rust/hg-pyo3/src/revlog/mod.rs	Mon Dec 23 21:30:02 2024 +0100
@@ -387,6 +387,21 @@
         })
     }
 
+    /// return the heads of the common ancestors of the given revs
+    #[pyo3(signature = (*revs))]
+    fn _index_commonancestorsheads(
+        slf: &Bound<'_, Self>,
+        revs: &Bound<'_, PyTuple>,
+    ) -> PyResult<Py<PyList>> {
+        Self::with_index_read(slf, |idx| {
+            let revs: Vec<_> = rev_pyiter_collect(revs, idx)?;
+            revs_py_list(
+                slf.py(),
+                idx.common_ancestor_heads(&revs).map_err(graph_error)?,
+            )
+        })
+    }
+
     /// reachableroots
     #[pyo3(signature = (*args))]
     fn _index_reachableroots2(