Mercurial > public > mercurial-scm > hg
diff rust/hg-core/src/dirstate.rs @ 46440: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 | 496537c9c1b4 |
children | f88e8ae0aa8f |
line wrap: on
line diff
--- a/rust/hg-core/src/dirstate.rs Wed Jan 27 13:41:28 2021 +0100 +++ b/rust/hg-core/src/dirstate.rs Wed Jan 27 14:00:21 2021 +0100 @@ -5,7 +5,8 @@ // This software may be used and distributed according to the terms of the // GNU General Public License version 2 or any later version. -use crate::{utils::hg_path::HgPathBuf, DirstateParseError, FastHashMap}; +use crate::errors::HgError; +use crate::{utils::hg_path::HgPathBuf, FastHashMap}; use std::collections::hash_map; use std::convert::TryFrom; @@ -60,7 +61,7 @@ } impl TryFrom<u8> for EntryState { - type Error = DirstateParseError; + type Error = HgError; fn try_from(value: u8) -> Result<Self, Self::Error> { match value { @@ -69,8 +70,8 @@ b'r' => Ok(EntryState::Removed), b'm' => Ok(EntryState::Merged), b'?' => Ok(EntryState::Unknown), - _ => Err(DirstateParseError::CorruptedEntry(format!( - "Incorrect entry state {}", + _ => Err(HgError::CorruptedRepository(format!( + "Incorrect dirstate entry state {}", value ))), }