Mercurial > public > mercurial-scm > hg
view rust/rhg/src/commands/debugrequirements.rs @ 52178:bd8081e9fd62
rust: don't star export from the `revlog` module
This made a lot of the imports confusing because they didn't make sense
at the top level (so, outside of `revlog`), and they hide the more common
types when autocompleting.
author | Rapha?l Gom?s <rgomes@octobus.net> |
---|---|
date | Thu, 26 Sep 2024 14:26:24 +0200 |
parents | 37bc3edef76f |
children |
line wrap: on
line source
use crate::error::CommandError; pub const HELP_TEXT: &str = " Print the current repo requirements. "; pub fn args() -> clap::Command { clap::command!("debugrequirements").about(HELP_TEXT) } pub fn run(invocation: &crate::CliInvocation) -> Result<(), CommandError> { let repo = invocation.repo?; 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(()) }