rust/hg-cpython/src/revlog.rs
changeset 51211 b8c89957a6b7
parent 51210 72d16685d63a
child 51212 9b06e7f32bc5
--- a/rust/hg-cpython/src/revlog.rs	Wed Aug 02 16:49:33 2023 +0200
+++ b/rust/hg-cpython/src/revlog.rs	Thu Aug 03 12:05:32 2023 +0200
@@ -257,8 +257,16 @@
     }
 
     /// True if the object is a snapshot
-    def issnapshot(&self, *args, **kw) -> PyResult<PyObject> {
-        self.call_cindex(py, "issnapshot", args, kw)
+    def issnapshot(&self, *args, **kw) -> PyResult<bool> {
+        let index = self.index(py).borrow();
+        let result = index
+            .is_snapshot(UncheckedRevision(args.get_item(py, 0).extract(py)?))
+            .map_err(|e| {
+                PyErr::new::<cpython::exc::ValueError, _>(py, e.to_string())
+            })?;
+        let cresult = self.call_cindex(py, "issnapshot", args, kw)?;
+        assert_eq!(result, cresult.extract(py)?);
+        Ok(result)
     }
 
     /// Gather snapshot data in a cache dict