Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/error.rs @ 46442:02d3bb972121
rust: replace RequirementsError with HgError
Differential Revision: https://phab.mercurial-scm.org/D9896
author | Simon Sapin <simon.sapin@octobus.net> |
---|---|
date | Wed, 27 Jan 2021 14:59:09 +0100 |
parents | 741e36f472a5 |
children | 43d63979a75e |
line wrap: on
line diff
--- a/rust/rhg/src/error.rs Wed Jan 27 15:04:51 2021 +0100 +++ b/rust/rhg/src/error.rs Wed Jan 27 14:59:09 2021 +0100 @@ -4,7 +4,6 @@ use format_bytes::format_bytes; use hg::errors::HgError; use hg::operations::FindRootError; -use hg::requirements::RequirementsError; use hg::revlog::revlog::RevlogError; use hg::utils::files::get_bytes_from_path; use std::convert::From; @@ -17,9 +16,6 @@ RootNotFound(PathBuf), /// The current directory cannot be found CurrentDirNotFound(std::io::Error), - /// `.hg/requires` - #[from] - RequirementsError(RequirementsError), /// The standard output stream cannot be written to StdoutError, /// The standard error stream cannot be written to @@ -38,10 +34,6 @@ match self { CommandError::RootNotFound(_) => exitcode::ABORT, CommandError::CurrentDirNotFound(_) => exitcode::ABORT, - CommandError::RequirementsError( - RequirementsError::Unsupported { .. }, - ) => exitcode::UNIMPLEMENTED_COMMAND, - CommandError::RequirementsError(_) => exitcode::ABORT, CommandError::StdoutError => exitcode::ABORT, CommandError::StderrError => exitcode::ABORT, CommandError::Abort(_) => exitcode::ABORT, @@ -67,15 +59,9 @@ b"abort: error getting current working directory: {}\n", e.to_string().as_bytes(), )), - CommandError::RequirementsError(RequirementsError::Corrupted) => { - Some( - "abort: .hg/requires is corrupted\n".as_bytes().to_owned(), - ) - } CommandError::Abort(message) => message.to_owned(), - CommandError::RequirementsError(_) - | CommandError::StdoutError + CommandError::StdoutError | CommandError::StderrError | CommandError::Unimplemented | CommandError::Other(HgError::UnsupportedFeature(_)) => None,