##// END OF EJS Templates
configitems: move blackbox's config items to the new configitems.toml...
configitems: move blackbox's config items to the new configitems.toml In order for the Rust code to gain access to default values of in-core extensions that have a Rust implementation, we need to centralize them alongside the core items declarations. This is the first and so far only one of the extensions that have gained Rust support, I don't think it's worth the churn to move the rest of the extension's configitems yet.

File last commit:

r50534:37bc3ede default
r51658:7f8f6fe1 default
Show More
debugrequirements.rs
22 lines | 598 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
Simon Sapin
requirements: move loading to hg-core and add parsing...
r46536 use crate::error::CommandError;
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
Raphaël Gomès
rhg: upgrade `clap` dependency...
r50534 pub fn args() -> clap::Command {
clap::command!("debugrequirements").about(HELP_TEXT)
Simon Sapin
rhg: Move subcommand CLI arguments definitions to respective modules...
r47251 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> {
Simon Sapin
rhg: Move `Repo` object creation into `main()`...
r47335 let repo = invocation.repo?;
Simon Sapin
rhg: replace command structs with functions...
r47250 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');
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }
Simon Sapin
rhg: Group values passed to every sub-command into a struct...
r47334 invocation.ui.write_stdout(output.as_bytes())?;
Simon Sapin
rhg: replace command structs with functions...
r47250 Ok(())
Simon Sapin
rhg: add a `debugrequirements` subcommand...
r46535 }