2 Commits

Author SHA1 Message Date
phundrak 77eab11588 docs(README): update the README to reflect new features
Run checks and build archives / coverage-and-sonar (push) Failing after 4m14s
Run checks and build archives / build (linux-aarch64) (push) Has been skipped
Run checks and build archives / build (linux-x86_64) (push) Has been skipped
Run checks and build archives / build (windows-x86_64) (push) Has been skipped
2026-06-14 15:09:16 +02:00
phundrak 6628e776e9 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 --new @`,
describing the current revision and creating a new revision after it.

Passing several revisions to `jj-cz` with the `--new` flag will result
in an error.
2026-06-14 14:13:17 +02:00
2 changed files with 9 additions and 10 deletions
+4 -2
View File
@@ -300,7 +300,8 @@ mod tests {
/// Test mock new_revision() returns configured error
#[tokio::test]
async fn mock_new_revision_returns_error() {
let mock = MockJjExecutor::new().with_new_revision_response(Err(Error::RepositoryLocked));
let mock =
MockJjExecutor::new().with_new_revision_response(Err(Error::RepositoryLocked));
let result = mock.new_revision("@").await;
assert!(result.is_err());
assert!(matches!(result.unwrap_err(), Error::RepositoryLocked));
@@ -309,7 +310,8 @@ mod tests {
/// Test mock new_revision() records revset even on error
#[tokio::test]
async fn mock_new_revision_records_revset_on_error() {
let mock = MockJjExecutor::new().with_new_revision_response(Err(Error::JjOperation {
let mock =
MockJjExecutor::new().with_new_revision_response(Err(Error::JjOperation {
context: "failed".to_string(),
}));
let result = mock.new_revision("abc").await;
+3 -6
View File
@@ -783,8 +783,8 @@ mod tests {
/// Test workflow new_revision() propagates executor errors
#[tokio::test]
async fn workflow_new_revision_propagates_error() {
let mock_executor =
MockJjExecutor::new().with_new_revision_response(Err(Error::RepositoryLocked));
let mock_executor = MockJjExecutor::new()
.with_new_revision_response(Err(Error::RepositoryLocked));
let workflow = CommitWorkflow::new(mock_executor);
let result = workflow.new_revision("@").await;
@@ -809,10 +809,7 @@ mod tests {
let workflow = CommitWorkflow::with_prompts(mock_executor, mock_prompts);
workflow.run_for_revset("@").await.expect("describe failed");
workflow
.new_revision("@")
.await
.expect("new_revision failed");
workflow.new_revision("@").await.expect("new_revision failed");
let messages = workflow.executor.describe_messages();
assert_eq!(messages.len(), 1);