comparison rust/hg-cpython/src/revlog.rs @ 51199:44fbb7dfb563

rust-index: renamed nodemap error function for rev not in index The function name was misleading, as the error wording mentions the nodemap, hence would not be appropriate for missing revisions not related to a nodemap lookup.
author Georges Racinet <georges.racinet@octobus.net>
date Wed, 18 Oct 2023 19:54:18 +0200
parents 51cc12158f97
children bc4d83047c6c
comparison
equal deleted inserted replaced
51198:51cc12158f97 51199:44fbb7dfb563
601 cls.call(py, (py.None(),), None).ok().into_py_object(py), 601 cls.call(py, (py.None(),), None).ok().into_py_object(py),
602 ), 602 ),
603 } 603 }
604 } 604 }
605 605
606 fn rev_not_in_index(py: Python, rev: UncheckedRevision) -> PyErr { 606 fn nodemap_rev_not_in_index(py: Python, rev: UncheckedRevision) -> PyErr {
607 PyErr::new::<ValueError, _>( 607 PyErr::new::<ValueError, _>(
608 py, 608 py,
609 format!( 609 format!(
610 "Inconsistency: Revision {} found in nodemap \ 610 "Inconsistency: Revision {} found in nodemap \
611 is not in revlog index", 611 is not in revlog index",
616 616
617 /// Standard treatment of NodeMapError 617 /// Standard treatment of NodeMapError
618 fn nodemap_error(py: Python, err: NodeMapError) -> PyErr { 618 fn nodemap_error(py: Python, err: NodeMapError) -> PyErr {
619 match err { 619 match err {
620 NodeMapError::MultipleResults => revlog_error(py), 620 NodeMapError::MultipleResults => revlog_error(py),
621 NodeMapError::RevisionNotInIndex(r) => rev_not_in_index(py, r), 621 NodeMapError::RevisionNotInIndex(r) => nodemap_rev_not_in_index(py, r),
622 } 622 }
623 } 623 }
624 624
625 /// Create the module, with __package__ given from parent 625 /// Create the module, with __package__ given from parent
626 pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> { 626 pub fn init_module(py: Python, package: &str) -> PyResult<PyModule> {