feat: implement --new flag

The new `--new` or `-n` flag allows to create a new revision after the
single revision being described. Running `jj-cz --new` is the
equivalent of running `jj-cz @ && jj new`. Running `jj-cz --new xs` is
the equivalent of running `jj-cz xs && jj new xs`.

Passing several revisions to `jj-cz` with the `--new` flag will result
in an error.

Refs: #6
This commit is contained in:
2026-06-07 12:37:18 +02:00
parent 0e6b559d00
commit e45130d31b
9 changed files with 446 additions and 19 deletions
+5
View File
@@ -21,6 +21,11 @@ pub trait JjExecutor: Send + Sync {
/// Get the current description of a specific revision
async fn get_description(&self, revset: &str) -> Result<String, Error>;
/// Create a new empty child revision parented on `revset`.
///
/// Equivalent to `jj new <revset>`
async fn new_revision(&self, revset: &str) -> Result<(), Error>;
}
#[cfg(test)]