# HG changeset patch # User Georges Racinet # Date 1695805144 -7200 # Node ID bc4d83047c6c5faf5fd2259f329e6589f55b87d4 # Parent 44fbb7dfb56347208f5d6bb27782c5fe407a8db4 rust-index: helper for revision not in index not involving nodemap This is a good match for exceptions raised from the C implementation, when it is not about a nodemap inconsistency. diff -r 44fbb7dfb563 -r bc4d83047c6c rust/hg-cpython/src/revlog.rs --- a/rust/hg-cpython/src/revlog.rs Wed Oct 18 19:54:18 2023 +0200 +++ b/rust/hg-cpython/src/revlog.rs Wed Sep 27 10:59:04 2023 +0200 @@ -614,6 +614,14 @@ ) } +#[allow(dead_code)] +fn rev_not_in_index(py: Python, rev: UncheckedRevision) -> PyErr { + PyErr::new::( + py, + format!("revlog index out of range: {}", rev), + ) +} + /// Standard treatment of NodeMapError fn nodemap_error(py: Python, err: NodeMapError) -> PyErr { match err {