rust/hg-cpython/src/revlog.rs
changeset 51195 51cc12158f97
parent 51194 4e6620b7fbbb
child 51196 44fbb7dfb563
--- a/rust/hg-cpython/src/revlog.rs	Mon Oct 30 10:34:48 2023 +0100
+++ b/rust/hg-cpython/src/revlog.rs	Thu Aug 03 10:28:10 2023 +0200
@@ -216,7 +216,12 @@
 
     /// return a binary packed version of the header
     def pack_header(&self, *args, **kw) -> PyResult<PyObject> {
-        self.call_cindex(py, "pack_header", args, kw)
+        let rindex = self.index(py).borrow();
+        let packed = rindex.pack_header(args.get_item(py, 0).extract(py)?);
+        let packed = PyBytes::new(py, &packed);
+        let cpacked = self.call_cindex(py, "pack_header", args, kw)?;
+        assert!(packed.as_object().compare(py, cpacked)?.is_eq());
+        Ok(packed.into_object())
     }
 
     /// get an index entry