255 def headrevsfiltered(&self, *args, **kw) -> PyResult<PyObject> { |
255 def headrevsfiltered(&self, *args, **kw) -> PyResult<PyObject> { |
256 self.call_cindex(py, "headrevsfiltered", args, kw) |
256 self.call_cindex(py, "headrevsfiltered", args, kw) |
257 } |
257 } |
258 |
258 |
259 /// True if the object is a snapshot |
259 /// True if the object is a snapshot |
260 def issnapshot(&self, *args, **kw) -> PyResult<PyObject> { |
260 def issnapshot(&self, *args, **kw) -> PyResult<bool> { |
261 self.call_cindex(py, "issnapshot", args, kw) |
261 let index = self.index(py).borrow(); |
|
262 let result = index |
|
263 .is_snapshot(UncheckedRevision(args.get_item(py, 0).extract(py)?)) |
|
264 .map_err(|e| { |
|
265 PyErr::new::<cpython::exc::ValueError, _>(py, e.to_string()) |
|
266 })?; |
|
267 let cresult = self.call_cindex(py, "issnapshot", args, kw)?; |
|
268 assert_eq!(result, cresult.extract(py)?); |
|
269 Ok(result) |
262 } |
270 } |
263 |
271 |
264 /// Gather snapshot data in a cache dict |
272 /// Gather snapshot data in a cache dict |
265 def findsnapshots(&self, *args, **kw) -> PyResult<PyObject> { |
273 def findsnapshots(&self, *args, **kw) -> PyResult<PyObject> { |
266 self.call_cindex(py, "findsnapshots", args, kw) |
274 self.call_cindex(py, "findsnapshots", args, kw) |