Mercurial > public > mercurial-scm > hg-stable
diff rust/hg-cpython/src/parsers.rs @ 46508:776b97179c06
rust: Remove DirstateParseError and ListDirstateTrackedFilesError
Use HgError instead.
Differential Revision: https://phab.mercurial-scm.org/D9894
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 27 Jan 2021 14:00:21 +0100 |
parents | 68a15b5a7e58 |
children | 98a455a62699 |
line wrap: on
line diff
--- a/rust/hg-cpython/src/parsers.rs Wed Jan 27 13:41:28 2021 +0100 +++ b/rust/hg-cpython/src/parsers.rs Wed Jan 27 14:00:21 2021 +0100 @@ -15,7 +15,7 @@ }; use hg::{ pack_dirstate, parse_dirstate, utils::hg_path::HgPathBuf, DirstateEntry, - DirstateParents, DirstateParseError, FastHashMap, PARENT_SIZE, + DirstateParents, FastHashMap, PARENT_SIZE, }; use std::convert::TryInto; @@ -58,21 +58,7 @@ .to_py_object(py), ) } - Err(e) => Err(PyErr::new::<exc::ValueError, _>( - py, - match e { - DirstateParseError::TooLittleData => { - "too little data for parents".to_string() - } - DirstateParseError::Overflow => { - "overflow in dirstate".to_string() - } - DirstateParseError::CorruptedEntry(e) => e, - DirstateParseError::Damaged => { - "dirstate appears to be damaged".to_string() - } - }, - )), + Err(e) => Err(PyErr::new::<exc::ValueError, _>(py, e.to_string())), } }