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.
--- 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::<ValueError, _>(
+ py,
+ format!("revlog index out of range: {}", rev),
+ )
+}
+
/// Standard treatment of NodeMapError
fn nodemap_error(py: Python, err: NodeMapError) -> PyErr {
match err {