comparison rust/hg-cpython/src/exceptions.rs @ 52785:2fb13c3f4496

rust: add GraphError::ParentOutOfOrder This will be used in a follow-up commit that creates a data structure optimized for inserting revisions in descending order, since it will need to fail if a revision number is greater than its descendant (meaning the graph is corrupted).
author Mitchell Kember <mkember@janestreet.com>
date Fri, 07 Feb 2025 16:07:35 -0500
parents 4c5f6e95df84
children
comparison
equal deleted inserted replaced
52784:7b4548a075ab 52785:2fb13c3f4496
25 impl GraphError { 25 impl GraphError {
26 pub fn pynew(py: Python, inner: hg::GraphError) -> PyErr { 26 pub fn pynew(py: Python, inner: hg::GraphError) -> PyErr {
27 match inner { 27 match inner {
28 hg::GraphError::ParentOutOfRange(r) => { 28 hg::GraphError::ParentOutOfRange(r) => {
29 GraphError::new(py, ("ParentOutOfRange", PyRevision(r.0))) 29 GraphError::new(py, ("ParentOutOfRange", PyRevision(r.0)))
30 }
31 hg::GraphError::ParentOutOfOrder(r) => {
32 GraphError::new(py, ("ParentOutOfOrder", PyRevision(r.0)))
30 } 33 }
31 } 34 }
32 } 35 }
33 36
34 pub fn pynew_from_vcsgraph( 37 pub fn pynew_from_vcsgraph(