comparison rust/hg-cpython/src/revlog.rs @ 51197: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
comparison
equal deleted inserted replaced
51196:44fbb7dfb563 51197:bc4d83047c6c
612 rev 612 rev
613 ), 613 ),
614 ) 614 )
615 } 615 }
616 616
617 #[allow(dead_code)]
618 fn rev_not_in_index(py: Python, rev: UncheckedRevision) -> PyErr {
619 PyErr::new::<ValueError, _>(
620 py,
621 format!("revlog index out of range: {}", rev),
622 )
623 }
624
617 /// Standard treatment of NodeMapError 625 /// Standard treatment of NodeMapError
618 fn nodemap_error(py: Python, err: NodeMapError) -> PyErr { 626 fn nodemap_error(py: Python, err: NodeMapError) -> PyErr {
619 match err { 627 match err {
620 NodeMapError::MultipleResults => revlog_error(py), 628 NodeMapError::MultipleResults => revlog_error(py),
621 NodeMapError::RevisionNotInIndex(r) => nodemap_rev_not_in_index(py, r), 629 NodeMapError::RevisionNotInIndex(r) => nodemap_rev_not_in_index(py, r),