Patchwork D10098: rhg: Fall back to Python on unsupported `rhg config <section>`

login
register
mail settings
Submitter phabricator
Date March 3, 2021, 6:24 p.m.
Message ID <differential-rev-PHID-DREV-jzj4nbi5yhjmwmoap2si-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48413/
State Superseded
Headers show

Comments

phabricator - March 3, 2021, 6:24 p.m.
SimonSapin created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

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

CHANGE DETAILS




To: SimonSapin, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/rust/rhg/src/commands/config.rs b/rust/rhg/src/commands/config.rs
--- a/rust/rhg/src/commands/config.rs
+++ b/rust/rhg/src/commands/config.rs
@@ -27,7 +27,7 @@ 
         .expect("missing required CLI argument")
         .as_bytes()
         .split_2(b'.')
-        .ok_or_else(|| HgError::abort(""))?;
+        .ok_or_else(|| HgError::unsupported("hg config <section>"))?;
 
     let value = invocation.config.get(section, name).unwrap_or(b"");