changeset 52825:1cd75e5d6347

rust-pyo3-revlog: delay
author Rapha?l Gom?s <rgomes@octobus.net>
date Fri, 03 Jan 2025 12:50:25 +0100
parents 14824d621c2c
children 9dcba9b379cb
files rust/hg-pyo3/src/revlog/mod.rs
diffstat 1 files changed, 11 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/rust/hg-pyo3/src/revlog/mod.rs	Fri Jan 03 12:45:33 2025 +0100
+++ b/rust/hg-pyo3/src/revlog/mod.rs	Fri Jan 03 12:50:25 2025 +0100
@@ -393,6 +393,17 @@
         })
     }
 
+    fn delay(
+        slf: &Bound<'_, Self>,
+        py: Python<'_>,
+    ) -> PyResult<Option<Py<PyBytes>>> {
+        Self::with_core_write(slf, |_self_ref, mut irl| {
+            let path = irl.delay().map_err(revlog_error_from_msg)?;
+            Ok(path
+                .map(|p| PyBytes::new(py, &get_bytes_from_path(p)).unbind()))
+        })
+    }
+
     fn _chunk(
         slf: &Bound<'_, Self>,
         py: Python<'_>,