rust/hg-cpython/src/revlog.rs
changeset 51211 b8c89957a6b7
parent 51210 72d16685d63a
child 51212 9b06e7f32bc5
equal deleted inserted replaced
51210:72d16685d63a 51211:b8c89957a6b7
   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)