equal
deleted
inserted
replaced
1 use crate::error::CommandError; |
1 use crate::error::CommandError; |
2 use crate::ui::{print_narrow_sparse_warnings, Ui}; |
2 use crate::ui::{print_narrow_sparse_warnings, Ui, RelativePaths, relative_paths}; |
3 use crate::utils::path_utils::RelativizePaths; |
3 use crate::utils::path_utils::RelativizePaths; |
4 use clap::Arg; |
4 use clap::Arg; |
5 use hg::narrow; |
5 use hg::narrow; |
6 use hg::operations::list_rev_tracked_files; |
6 use hg::operations::list_rev_tracked_files; |
7 use hg::repo::Repo; |
7 use hg::repo::Repo; |
26 ) |
26 ) |
27 .about(HELP_TEXT) |
27 .about(HELP_TEXT) |
28 } |
28 } |
29 |
29 |
30 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { |
30 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { |
31 let relative = invocation.config.get(b"ui", b"relative-paths"); |
31 match relative_paths(invocation.config)? { |
32 if relative.is_some() { |
32 RelativePaths::Legacy | RelativePaths::Bool(true) => (), |
|
33 RelativePaths::Bool(false) => { |
33 return Err(CommandError::unsupported( |
34 return Err(CommandError::unsupported( |
34 "non-default ui.relative-paths", |
35 "non-default ui.relative-paths", |
35 )); |
36 )); |
|
37 } |
36 } |
38 } |
37 |
39 |
38 let rev = invocation.subcommand_args.get_one::<String>("rev"); |
40 let rev = invocation.subcommand_args.get_one::<String>("rev"); |
39 |
41 |
40 let repo = invocation.repo?; |
42 let repo = invocation.repo?; |