upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/src/sub_commands/push.rs
diff options
context:
space:
mode:
authorDanConwayDev <DanConwayDev@protonmail.com>2024-07-05 11:06:04 +0100
committerDanConwayDev <DanConwayDev@protonmail.com>2024-07-05 11:06:04 +0100
commitba82a894fad645757c49242c11573b6c5dd8d1e6 (patch)
tree4026fe28e40260578a817154c9ed614a16dfcb7f /src/sub_commands/push.rs
parentd70a6ef029b90d00024da82e945316ce58b9507b (diff)
feat(init): group by statusv1.3-beta1
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'
Diffstat (limited to 'src/sub_commands/push.rs')
-rw-r--r--src/sub_commands/push.rs13
1 files changed, 8 insertions, 5 deletions
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::{
13 sub_commands::{ 13 sub_commands::{
14 self, 14 self,
15 list::{ 15 list::{
16 find_commits_for_proposal_root_events, find_proposal_events, get_commit_id_from_patch, 16 find_commits_for_proposal_root_events, find_proposal_and_status_events,
17 get_most_recent_patch_with_ancestors, tag_value, 17 get_commit_id_from_patch, get_most_recent_patch_with_ancestors, tag_value,
18 },
19 send::{
20 event_is_revision_root, event_to_cover_letter, generate_patch_event, send_events,
21 PATCH_KIND,
18 }, 22 },
19 send::{event_is_revision_root, event_to_cover_letter, generate_patch_event, send_events},
20 }, 23 },
21 Cli, 24 Cli,
22}; 25};
@@ -207,13 +210,13 @@ pub async fn fetch_proposal_root_and_most_recent_patch_chain(
207 println!("finding proposal root event..."); 210 println!("finding proposal root event...");
208 211
209 let proposal_events_and_revisions: Vec<nostr::Event> = 212 let proposal_events_and_revisions: Vec<nostr::Event> =
210 find_proposal_events(client, repo_ref, &root_commit.to_string()) 213 find_proposal_and_status_events(client, repo_ref, &root_commit.to_string())
211 .await 214 .await
212 .context("cannot get proposal events for repo")?; 215 .context("cannot get proposal events for repo")?;
213 216
214 let proposal_events: Vec<&nostr::Event> = proposal_events_and_revisions 217 let proposal_events: Vec<&nostr::Event> = proposal_events_and_revisions
215 .iter() 218 .iter()
216 .filter(|e| !event_is_revision_root(e)) 219 .filter(|e| !event_is_revision_root(e) && e.kind().as_u16().eq(&PATCH_KIND))
217 .collect::<Vec<&nostr::Event>>(); 220 .collect::<Vec<&nostr::Event>>();
218 221
219 let proposal_root_event: &nostr::Event = proposal_events 222 let proposal_root_event: &nostr::Event = proposal_events