[Updated] D11943: rhg: Fall back to Python if verbose status is requested by config

SimonSapin phabricator at mercurial-scm.org
Mon Dec 20 13:35:01 UTC 2021


Closed by commit rHG47f2a82ae3e4: rhg: Fall back to Python if verbose status is requested by config (authored by SimonSapin).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11943?vs=31552&id=31556

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

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

AFFECTED FILES
  rust/rhg/src/commands/status.rs
  rust/rhg/src/ui.rs
  tests/test-conflict.t

CHANGE DETAILS

diff --git a/tests/test-conflict.t b/tests/test-conflict.t
--- a/tests/test-conflict.t
+++ b/tests/test-conflict.t
@@ -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.
diff --git a/rust/rhg/src/ui.rs b/rust/rhg/src/ui.rs
--- a/rust/rhg/src/ui.rs
+++ b/rust/rhg/src/ui.rs
@@ -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
diff --git a/rust/rhg/src/commands/status.rs b/rust/rhg/src/commands/status.rs
--- a/rust/rhg/src/commands/status.rs
+++ b/rust/rhg/src/commands/status.rs
@@ -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



To: SimonSapin, #hg-reviewers, Alphare
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20211220/eb249ee9/attachment-0002.html>


More information about the Mercurial-patches mailing list