Patchwork D10137: rhg: Fall back to Python if ui.relative-paths=no is configured

login
register
mail settings
Submitter phabricator
Date March 9, 2021, 9:42 a.m.
Message ID <differential-rev-PHID-DREV-dhypl74gjfxv76bd3www-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48449/
State Superseded
Headers show

Comments

phabricator - March 9, 2021, 9:42 a.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/D10137

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

CHANGE DETAILS




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

Patch

diff --git a/rust/rhg/src/commands/files.rs b/rust/rhg/src/commands/files.rs
--- a/rust/rhg/src/commands/files.rs
+++ b/rust/rhg/src/commands/files.rs
@@ -27,6 +27,11 @@ 
 }
 
 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
+    let relative = invocation.config.get(b"ui", b"relative-paths");
+    if relative == Some(b"no") {
+        return Err(CommandError::unsupported("ui.relative-paths = no"));
+    }
+
     let rev = invocation.subcommand_args.value_of("rev");
 
     let repo = invocation.repo?;