rhg: Fall back to Python if verbose status is requested by config
authorSimon Sapin <simon.sapin@octobus.net>
Sat, 18 Dec 2021 11:47:03 +0100
changeset 48513 47f2a82ae3e4
parent 48512 262a38f10427
child 48514 fb691fa90807
rhg: Fall back to Python if verbose status is requested by config Differential Revision: https://phab.mercurial-scm.org/D11943
rust/rhg/src/commands/status.rs
rust/rhg/src/ui.rs
tests/test-conflict.t
--- a/rust/rhg/src/commands/status.rs	Fri Dec 17 17:56:13 2021 +0100
+++ b/rust/rhg/src/commands/status.rs	Sat Dec 18 11:47:03 2021 +0100
@@ -182,6 +182,17 @@
     let ui = invocation.ui;
     let config = invocation.config;
     let args = invocation.subcommand_args;
+
+    let verbose = !ui.plain()
+        && !args.is_present("print0")
+        && (config.get_bool(b"ui", b"verbose")?
+            || config.get_bool(b"commands", b"status.verbose")?);
+    if verbose {
+        return Err(CommandError::unsupported(
+            "verbose status is not supported yet",
+        ));
+    }
+
     let all = args.is_present("all");
     let display_states = if all {
         // TODO when implementing `--quiet`: it excludes clean files
--- a/rust/rhg/src/ui.rs	Fri Dec 17 17:56:13 2021 +0100
+++ b/rust/rhg/src/ui.rs	Sat Dec 18 11:47:03 2021 +0100
@@ -51,7 +51,7 @@
         stderr.flush().or_else(handle_stderr_error)
     }
 
-    /// is plain mode active
+    /// Return whether plain mode is active.
     ///
     /// Plain mode means that all configuration variables which affect
     /// the behavior and output of Mercurial should be
--- a/tests/test-conflict.t	Fri Dec 17 17:56:13 2021 +0100
+++ b/tests/test-conflict.t	Sat Dec 18 11:47:03 2021 +0100
@@ -1,7 +1,3 @@
-TODO: fix rhg bugs that make this test fail when status is enabled
-  $ unset RHG_STATUS
-
-
   $ hg init
   $ cat << EOF > a
   > Small Mathematical Series.