changeset 52831:acd76143f868

rust-pyo3-revlog: _deltachain
author Rapha?l Gom?s <rgomes@octobus.net>
date Thu, 02 Jan 2025 23:59:26 +0100
parents 5950957af8a3
children 88a69ebbba3b
files rust/hg-pyo3/src/revlog/mod.rs
diffstat 1 files changed, 19 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-pyo3/src/revlog/mod.rs	Thu Jan 02 23:37:14 2025 +0100
+++ b/rust/hg-pyo3/src/revlog/mod.rs	Thu Jan 02 23:59:26 2025 +0100
@@ -286,6 +286,25 @@
         Self::_index_issnapshot(slf, rev)
     }
 
+    #[pyo3(signature = (rev, stoprev=None))]
+    fn _deltachain(
+        slf: &Bound<'_, Self>,
+        py: Python<'_>,
+        rev: PyRevision,
+        stoprev: Option<PyRevision>,
+    ) -> PyResult<Py<PyTuple>> {
+        Self::with_index_read(slf, |idx| {
+            let using_general_delta = idx.uses_generaldelta();
+            Self::_index_deltachain(
+                slf,
+                py,
+                rev,
+                stoprev,
+                Some(using_general_delta.into()),
+            )
+        })
+    }
+
     fn reading(slf: &Bound<'_, Self>) -> PyResult<ReadingContextManager> {
         Ok(ReadingContextManager {
             inner_revlog: slf.clone().unbind(),