[Updated] D8864: rhg: Do not return error when when we really mean ok in commands

acezar (Antoine Cezar) phabricator at mercurial-scm.org
Sat Aug 8 20:30:39 UTC 2020


Closed by commit rHG227281e76c22: rhg: Do not return error when when we really mean ok in commands (authored by acezar).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8864?vs=22248&id=22359

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8864/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8864

AFFECTED FILES
  rust/rhg/src/commands/root.rs
  rust/rhg/src/error.rs

CHANGE DETAILS

diff --git a/rust/rhg/src/error.rs b/rust/rhg/src/error.rs
--- a/rust/rhg/src/error.rs
+++ b/rust/rhg/src/error.rs
@@ -5,8 +5,6 @@
 /// The kind of command error
 #[derive(Debug, PartialEq)]
 pub enum CommandErrorKind {
-    /// The command finished without error
-    Ok,
     /// The root of the repository cannot be found
     RootNotFound,
     /// The current directory cannot be found
@@ -20,7 +18,6 @@
 impl CommandErrorKind {
     pub fn get_exit_code(&self) -> exitcode::ExitCode {
         match self {
-            CommandErrorKind::Ok => exitcode::OK,
             CommandErrorKind::RootNotFound => exitcode::ABORT,
             CommandErrorKind::CurrentDirNotFound => exitcode::ABORT,
             CommandErrorKind::StdoutError => exitcode::ABORT,
diff --git a/rust/rhg/src/commands/root.rs b/rust/rhg/src/commands/root.rs
--- a/rust/rhg/src/commands/root.rs
+++ b/rust/rhg/src/commands/root.rs
@@ -29,7 +29,7 @@
         // TODO use formating macro
         self.ui.write_stdout(&[bytes.as_slice(), b"\n"].concat())?;
 
-        Err(CommandErrorKind::Ok.into())
+        Ok(())
     }
 
     fn display_error(&self, error: FindRootError) -> Result<(), CommandError> {



To: acezar, #hg-reviewers, Alphare, indygreg
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20200808/2f4c7acd/attachment-0002.html>


More information about the Mercurial-patches mailing list