changeset 52826:9dcba9b379cb

rust-pyo3-revlog: finalize_pending
author Rapha?l Gom?s <rgomes@octobus.net>
date Fri, 03 Jan 2025 12:51:25 +0100
parents 1cd75e5d6347
children 50c0c74ca266
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:50:25 2025 +0100
+++ b/rust/hg-pyo3/src/revlog/mod.rs	Fri Jan 03 12:51:25 2025 +0100
@@ -404,6 +404,17 @@
         })
     }
 
+    fn finalize_pending(
+        slf: &Bound<'_, Self>,
+        py: Python<'_>,
+    ) -> PyResult<Py<PyBytes>> {
+        Self::with_core_write(slf, |_self_ref, mut irl| {
+            let path =
+                irl.finalize_pending().map_err(revlog_error_from_msg)?;
+            Ok(PyBytes::new(py, &get_bytes_from_path(path)).unbind())
+        })
+    }
+
     fn _chunk(
         slf: &Bound<'_, Self>,
         py: Python<'_>,