diff -r 5ad4ed71fbe0 -r adf91dfe6c04 rust/hg-pyo3/src/exceptions.rs --- a/rust/hg-pyo3/src/exceptions.rs Wed Dec 25 19:05:27 2024 +0100 +++ b/rust/hg-pyo3/src/exceptions.rs Wed Dec 25 19:06:59 2024 +0100 @@ -78,3 +78,9 @@ } } } + +pub fn graph_error(_err: hg::GraphError) -> PyErr { + // ParentOutOfRange is currently the only alternative + // in `hg::GraphError`. The C index always raises this simple ValueError. + PyValueError::new_err("parent out of range") +}