Mercurial > hg
changeset 51200:bc4d83047c6c
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.
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Wed, 27 Sep 2023 10:59:04 +0200 |
parents | 44fbb7dfb563 |
children | 52bbb57a76ad |
files | rust/hg-cpython/src/revlog.rs |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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 {