feat: set message for multiple revsets
Allows to set the revision message of multiple revisions by passing them as arguments. This only supports simple revisions, such as `@`, `@-`, `xs`, and so on. Comple revisions such as `@..@-` are not supported. Fixes: #5
This commit is contained in:
+16
-1
@@ -14,4 +14,19 @@ use clap::Parser;
|
||||
Jujutsu repository.\n\n\
|
||||
This tool requires an interactive terminal (TTY)."
|
||||
)]
|
||||
pub struct Cli;
|
||||
pub struct Cli {
|
||||
/// The revision(s) whose description to edit (default: @)
|
||||
#[arg(value_name = "REVSETS")]
|
||||
revsets: Vec<String>,
|
||||
}
|
||||
|
||||
impl Cli {
|
||||
/// Returns the revsets to operate on, defaulting to `["@"]` if none provided
|
||||
pub fn revsets(&self) -> Vec<&str> {
|
||||
if self.revsets.is_empty() {
|
||||
vec!["@"]
|
||||
} else {
|
||||
self.revsets.iter().map(|s| s.as_str()).collect()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user