From b4bc032113ac663575f45c24421804b60737da7e Mon Sep 17 00:00:00 2001 From: Alexis Sellier Date: Wed, 16 Nov 2022 15:07:09 +0100 Subject: [PATCH] Add `rad-merge` command Signed-off-by: Alexis Sellier --- radicle-cli/src/commands.rs | 2 + radicle-cli/src/commands/merge.rs | 385 +++++++++++++++++++++++++++++ radicle-cli/src/terminal/format.rs | 3 +- 3 files changed, 389 insertions(+), 1 deletion(-) create mode 100644 radicle-cli/src/commands/merge.rs diff --git a/radicle-cli/src/commands.rs b/radicle-cli/src/commands.rs index e456759b..b03d90d5 100644 --- a/radicle-cli/src/commands.rs +++ b/radicle-cli/src/commands.rs @@ -16,6 +16,8 @@ pub mod rad_inspect; pub mod rad_issue; #[path = "commands/ls.rs"] pub mod rad_ls; +#[path = "commands/merge.rs"] +pub mod rad_merge; #[path = "commands/patch.rs"] pub mod rad_patch; #[path = "commands/push.rs"] diff --git a/radicle-cli/src/commands/merge.rs b/radicle-cli/src/commands/merge.rs new file mode 100644 index 00000000..0f381ba3 --- /dev/null +++ b/radicle-cli/src/commands/merge.rs @@ -0,0 +1,385 @@ +use std::ffi::OsString; +use std::fmt; +use std::fmt::Write; +use std::str::FromStr; + +use anyhow::{anyhow, Context}; + +use crate::terminal as term; +use crate::terminal::args::{Args, Error, Help}; +use radicle::cob; +use radicle::cob::patch::RevisionIx; +use radicle::cob::patch::{Patch, PatchId}; +use radicle::git; +use radicle::prelude::*; +use radicle::rad; + +pub const HELP: Help = Help { + name: "merge", + description: "Merge radicle patches", + version: env!("CARGO_PKG_VERSION"), + usage: r#" +Usage + + rad merge [] [