diff options
| author | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-29 12:44:06 +0000 |
|---|---|---|
| committer | DanConwayDev <DanConwayDev@protonmail.com> | 2024-02-29 13:00:02 +0000 |
| commit | 8de147768c2de3221d0a119278e76c013d20b0f1 (patch) | |
| tree | 79f9e793dc9a36b6ded9aa748a257730c864ea31 | |
| parent | 8f8bfcb536a56a6fefde62c4a6ba2289be2b88b9 (diff) | |
feat(send): add proposal revision cli msg
before cover letter prompt
primarily this is to make it clearer that a proposal update
is being sent when using `ngit push --force` instead of
a new proposal
| -rw-r--r-- | src/sub_commands/send.rs | 4 | ||||
| -rw-r--r-- | tests/push.rs | 4 | ||||
| -rw-r--r-- | tests/send.rs | 16 |
3 files changed, 24 insertions, 0 deletions
diff --git a/src/sub_commands/send.rs b/src/sub_commands/send.rs index 5994f4f..23016e1 100644 --- a/src/sub_commands/send.rs +++ b/src/sub_commands/send.rs | |||
| @@ -96,6 +96,10 @@ pub async fn launch(cli_args: &Cli, args: &SubCommandArgs) -> Result<()> { | |||
| 96 | } | 96 | } |
| 97 | }; | 97 | }; |
| 98 | 98 | ||
| 99 | if let Some(id) = &args.in_reply_to { | ||
| 100 | println!("as a revision to proposal: {id}"); | ||
| 101 | } | ||
| 102 | |||
| 99 | let title = if args.no_cover_letter { | 103 | let title = if args.no_cover_letter { |
| 100 | None | 104 | None |
| 101 | } else { | 105 | } else { |
diff --git a/tests/push.rs b/tests/push.rs index 0705174..d295c01 100644 --- a/tests/push.rs +++ b/tests/push.rs | |||
| @@ -592,6 +592,10 @@ mod when_branch_is_checked_out { | |||
| 592 | 592 | ||
| 593 | // standard output from `ngit send` | 593 | // standard output from `ngit send` |
| 594 | p.expect(format!("creating patch for 2 commits from '{FEATURE_BRANCH_NAME_1}' that can be merged into 'main'\r\n"))?; | 594 | p.expect(format!("creating patch for 2 commits from '{FEATURE_BRANCH_NAME_1}' that can be merged into 'main'\r\n"))?; |
| 595 | p.expect("as a revision to proposal: ")?; | ||
| 596 | // proposal id will be printed in this gap | ||
| 597 | p.expect_eventually("\r\n")?; | ||
| 598 | |||
| 595 | p.expect("searching for profile and relay updates...\r\n")?; | 599 | p.expect("searching for profile and relay updates...\r\n")?; |
| 596 | p.expect("\r")?; | 600 | p.expect("\r")?; |
| 597 | p.expect("logged in as fred\r\n")?; | 601 | p.expect("logged in as fred\r\n")?; |
diff --git a/tests/send.rs b/tests/send.rs index 2c86566..4b68821 100644 --- a/tests/send.rs +++ b/tests/send.rs | |||
| @@ -1416,6 +1416,22 @@ mod specify_in_reply_to { | |||
| 1416 | ]; | 1416 | ]; |
| 1417 | CliTester::new_from_dir(&git_repo.dir, args) | 1417 | CliTester::new_from_dir(&git_repo.dir, args) |
| 1418 | } | 1418 | } |
| 1419 | fn expect_msgs_first(p: &mut CliTester, include_cover_letter: bool) -> Result<()> { | ||
| 1420 | p.expect("creating patch for 2 commits from 'feature' that can be merged into 'main'\r\n")?; | ||
| 1421 | p.expect("as a revision to proposal: nevent1qqsypm62fzw7qynvlc4gjl3tr0jw4vmh659nvr2cc5qyhdg92a5yy0qzypumuen7l8wthtz45p3ftn58pvrs9xlumvkuu2xet8egzkcklqtesxygzam\r\n")?; | ||
| 1422 | p.expect("searching for profile and relay updates...\r\n")?; | ||
| 1423 | p.expect("\r")?; | ||
| 1424 | p.expect("logged in as fred\r\n")?; | ||
| 1425 | p.expect(format!( | ||
| 1426 | "posting 2 patches {} a covering letter...\r\n", | ||
| 1427 | if include_cover_letter { | ||
| 1428 | "with" | ||
| 1429 | } else { | ||
| 1430 | "without" | ||
| 1431 | } | ||
| 1432 | ))?; | ||
| 1433 | Ok(()) | ||
| 1434 | } | ||
| 1419 | 1435 | ||
| 1420 | async fn prep_run_create_proposal() -> Result<( | 1436 | async fn prep_run_create_proposal() -> Result<( |
| 1421 | Relay<'static>, | 1437 | Relay<'static>, |