Mercurial > public > mercurial-scm > hg
diff rust/rhg/src/commands/files.rs @ 50536:74e4dbb0fcd5
rhg: make `rhg files` work if `ui.relative-files=true` is specified
author | Arseniy Alekseyev <aalekseyev@janestreet.com> |
---|---|
date | Mon, 29 May 2023 16:53:18 +0100 |
parents | e57f76c28f7b |
children | 9db197c73138 |
line wrap: on
line diff
--- a/rust/rhg/src/commands/files.rs Mon May 29 16:47:39 2023 +0100 +++ b/rust/rhg/src/commands/files.rs Mon May 29 16:53:18 2023 +0100 @@ -1,5 +1,5 @@ use crate::error::CommandError; -use crate::ui::{print_narrow_sparse_warnings, Ui}; +use crate::ui::{print_narrow_sparse_warnings, Ui, RelativePaths, relative_paths}; use crate::utils::path_utils::RelativizePaths; use clap::Arg; use hg::narrow; @@ -28,11 +28,13 @@ } pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { - let relative = invocation.config.get(b"ui", b"relative-paths"); - if relative.is_some() { + match relative_paths(invocation.config)? { + RelativePaths::Legacy | RelativePaths::Bool(true) => (), + RelativePaths::Bool(false) => { return Err(CommandError::unsupported( "non-default ui.relative-paths", )); + } } let rev = invocation.subcommand_args.get_one::<String>("rev");