Show More
@@ -304,8 +304,17 py_class!(pub class Index |py| { | |||||
304 | } |
|
304 | } | |
305 |
|
305 | |||
306 | /// get head revisions |
|
306 | /// get head revisions | |
307 | def headrevs(&self) -> PyResult<PyObject> { |
|
307 | def headrevs(&self, *args, **_kw) -> PyResult<PyObject> { | |
308 | let rust_res = self.inner_headrevs(py)?; |
|
308 | let filtered_revs = match &args.len(py) { | |
|
309 | 0 => Ok(py.None()), | |||
|
310 | 1 => Ok(args.get_item(py, 0)), | |||
|
311 | _ => Err(PyErr::new::<cpython::exc::TypeError, _>(py, "too many arguments")), | |||
|
312 | }?; | |||
|
313 | let rust_res = if filtered_revs.is_none(py) { | |||
|
314 | self.inner_headrevs(py) | |||
|
315 | } else { | |||
|
316 | self.inner_headrevsfiltered(py, &filtered_revs) | |||
|
317 | }?; | |||
309 | Ok(rust_res) |
|
318 | Ok(rust_res) | |
310 | } |
|
319 | } | |
311 |
|
320 |
General Comments 0
You need to be logged in to leave comments.
Login now