##// END OF EJS Templates
rust: Remove unnecessary check for absolute path before joining...
rust: Remove unnecessary check for absolute path before joining `Path::join` does the right thing if its argument is absolute. Differential Revision: https://phab.mercurial-scm.org/D9960

File last commit:

r47190:d03b0601 default
r47211:39128182 default
Show More
debugrequirements.rs
31 lines | 775 B | application/rls-services+xml | RustLexer
/ rust / rhg / src / commands / debugrequirements.rs
use crate::commands::Command;
use crate::error::CommandError;
use crate::ui::Ui;
use hg::repo::Repo;
pub const HELP_TEXT: &str = "
Print the current repo requirements.
";
pub struct DebugRequirementsCommand {}
impl DebugRequirementsCommand {
pub fn new() -> Self {
DebugRequirementsCommand {}
}
}
impl Command for DebugRequirementsCommand {
fn run(&self, ui: &Ui) -> Result<(), CommandError> {
let repo = Repo::find()?;
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');
}
ui.write_stdout(output.as_bytes())?;
Ok(())
}
}