[Commented On] D11759: rhg: Propagate config errors in `rhg status`

baymax (Baymax, Your Personal Patch-care Companion) phabricator at mercurial-scm.org
Fri Nov 26 15:33:04 UTC 2021


baymax added a comment.
baymax updated this revision to Diff 31157.


  ✅ refresh by Heptapod after a successful CI run (🐙 💚)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D11759?vs=31144&id=31157

BRANCH
  default

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

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

AFFECTED FILES
  rust/rhg/src/commands/status.rs

CHANGE DETAILS

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
@@ -138,12 +138,12 @@
     }
 
     // TODO: lift these limitations
-    if invocation.config.get_bool(b"ui", b"tweakdefaults").ok() == Some(true) {
+    if invocation.config.get_bool(b"ui", b"tweakdefaults")? {
         return Err(CommandError::unsupported(
             "ui.tweakdefaults is not yet supported with rhg status",
         ));
     }
-    if invocation.config.get_bool(b"ui", b"statuscopies").ok() == Some(true) {
+    if invocation.config.get_bool(b"ui", b"statuscopies")? {
         return Err(CommandError::unsupported(
             "ui.statuscopies is not yet supported with rhg status",
         ));
@@ -263,10 +263,9 @@
     status_prefix: &[u8],
 ) -> Result<(), CommandError> {
     paths.sort_unstable();
-    let mut relative: bool =
-        config.get_bool(b"ui", b"relative-paths").unwrap_or(false);
+    let mut relative: bool = config.get_bool(b"ui", b"relative-paths")?;
     relative = config
-        .get_bool(b"commands", b"status.relative")
+        .get_option(b"commands", b"status.relative")?
         .unwrap_or(relative);
     if relative && !ui.plain() {
         relativize_paths(



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/20211126/f8690c56/attachment-0002.html>


More information about the Mercurial-patches mailing list