equal
deleted
inserted
replaced
1 use crate::error::CommandError; |
1 use crate::error::CommandError; |
2 use clap::Arg; |
2 use clap::Arg; |
3 use hg::operations::cat; |
3 use hg::operations::cat; |
4 use hg::repo::Repo; |
|
5 use hg::utils::hg_path::HgPathBuf; |
4 use hg::utils::hg_path::HgPathBuf; |
6 use micro_timer::timed; |
5 use micro_timer::timed; |
7 use std::convert::TryFrom; |
6 use std::convert::TryFrom; |
8 |
7 |
9 pub const HELP_TEXT: &str = " |
8 pub const HELP_TEXT: &str = " |
37 let file_args = match invocation.subcommand_args.values_of("files") { |
36 let file_args = match invocation.subcommand_args.values_of("files") { |
38 Some(files) => files.collect(), |
37 Some(files) => files.collect(), |
39 None => vec![], |
38 None => vec![], |
40 }; |
39 }; |
41 |
40 |
42 let repo = Repo::find(invocation.non_repo_config, invocation.repo_path)?; |
41 let repo = invocation.repo?; |
43 let cwd = hg::utils::current_dir()?; |
42 let cwd = hg::utils::current_dir()?; |
44 |
43 |
45 let mut files = vec![]; |
44 let mut files = vec![]; |
46 for file in file_args.iter() { |
45 for file in file_args.iter() { |
47 // TODO: actually normalize `..` path segments etc? |
46 // TODO: actually normalize `..` path segments etc? |