##// END OF EJS Templates
rhg: Group values passed to every sub-command into a struct...
rhg: Group values passed to every sub-command into a struct The set of which values this is is evidently not stable yet, so this will make changes easier. Also it is growing, and the function signatures are getting out hand. Differential Revision: https://phab.mercurial-scm.org/D10003

File last commit:

r47334:80840b65 default
r47334:80840b65 default
Show More
debugrequirements.rs
23 lines | 690 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
use crate::error::CommandError;
use hg::repo::Repo;
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
pub fn args() -> clap::App<'static, 'static> {
clap::SubCommand::with_name("debugrequirements").about(HELP_TEXT)
}
pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
let repo = Repo::find(invocation.non_repo_config, invocation.repo_path)?;
let mut output = String::new();
let mut requirements: Vec<_> = repo.requirements().iter().collect();
requirements.sort();
for req in requirements {
output.push_str(req);
output.push('\n');
}
invocation.ui.write_stdout(output.as_bytes())?;
Ok(())
}