From ba82a894fad645757c49242c11573b6c5dd8d1e6 Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Fri, 5 Jul 2024 11:06:04 +0100 Subject: feat(init): group by status show open proposal by defult and include options to filter by other statuses there are not tests for this currently as the intention is to transform 'list' further by adding a 'fetch' --- src/sub_commands/push.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/sub_commands/push.rs') diff --git a/src/sub_commands/push.rs b/src/sub_commands/push.rs index 3c471c0..9e3e041 100644 --- a/src/sub_commands/push.rs +++ b/src/sub_commands/push.rs @@ -13,10 +13,13 @@ use crate::{ sub_commands::{ self, list::{ - find_commits_for_proposal_root_events, find_proposal_events, get_commit_id_from_patch, - get_most_recent_patch_with_ancestors, tag_value, + find_commits_for_proposal_root_events, find_proposal_and_status_events, + get_commit_id_from_patch, get_most_recent_patch_with_ancestors, tag_value, + }, + send::{ + event_is_revision_root, event_to_cover_letter, generate_patch_event, send_events, + PATCH_KIND, }, - send::{event_is_revision_root, event_to_cover_letter, generate_patch_event, send_events}, }, Cli, }; @@ -207,13 +210,13 @@ pub async fn fetch_proposal_root_and_most_recent_patch_chain( println!("finding proposal root event..."); let proposal_events_and_revisions: Vec = - find_proposal_events(client, repo_ref, &root_commit.to_string()) + find_proposal_and_status_events(client, repo_ref, &root_commit.to_string()) .await .context("cannot get proposal events for repo")?; let proposal_events: Vec<&nostr::Event> = proposal_events_and_revisions .iter() - .filter(|e| !event_is_revision_root(e)) + .filter(|e| !event_is_revision_root(e) && e.kind().as_u16().eq(&PATCH_KIND)) .collect::>(); let proposal_root_event: &nostr::Event = proposal_events -- cgit v1.2.3