##// END OF EJS Templates
rhg: Do not return error when when we really mean ok in commands...
Antoine Cezar -
r45919:227281e7 default
parent child Browse files
Show More
@@ -29,7 +29,7 b' impl RootCommand {'
29 // TODO use formating macro
29 // TODO use formating macro
30 self.ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
30 self.ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
31
31
32 Err(CommandErrorKind::Ok.into())
32 Ok(())
33 }
33 }
34
34
35 fn display_error(&self, error: FindRootError) -> Result<(), CommandError> {
35 fn display_error(&self, error: FindRootError) -> Result<(), CommandError> {
@@ -5,8 +5,6 b' use std::convert::From;'
5 /// The kind of command error
5 /// The kind of command error
6 #[derive(Debug, PartialEq)]
6 #[derive(Debug, PartialEq)]
7 pub enum CommandErrorKind {
7 pub enum CommandErrorKind {
8 /// The command finished without error
9 Ok,
10 /// The root of the repository cannot be found
8 /// The root of the repository cannot be found
11 RootNotFound,
9 RootNotFound,
12 /// The current directory cannot be found
10 /// The current directory cannot be found
@@ -20,7 +18,6 b' pub enum CommandErrorKind {'
20 impl CommandErrorKind {
18 impl CommandErrorKind {
21 pub fn get_exit_code(&self) -> exitcode::ExitCode {
19 pub fn get_exit_code(&self) -> exitcode::ExitCode {
22 match self {
20 match self {
23 CommandErrorKind::Ok => exitcode::OK,
24 CommandErrorKind::RootNotFound => exitcode::ABORT,
21 CommandErrorKind::RootNotFound => exitcode::ABORT,
25 CommandErrorKind::CurrentDirNotFound => exitcode::ABORT,
22 CommandErrorKind::CurrentDirNotFound => exitcode::ABORT,
26 CommandErrorKind::StdoutError => exitcode::ABORT,
23 CommandErrorKind::StdoutError => exitcode::ABORT,
General Comments 0
You need to be logged in to leave comments. Login now