mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-11-16 08:10:40 +08:00
cli: Add filtering based on author to rad patch
My use case for this is to have a script that lists my outstanding patches so I can ping people for review or merge if there's no movement for a long time. Signed-off-by: Lars Wirzenius <liw@liw.fi>
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
use std::collections::BTreeSet;
|
||||
|
||||
use radicle::cob::patch;
|
||||
use radicle::cob::patch::{Patch, PatchId, Patches, Verdict};
|
||||
use radicle::prelude::*;
|
||||
@@ -15,6 +17,7 @@ use super::common;
|
||||
/// List patches.
|
||||
pub fn run(
|
||||
filter: fn(&patch::State) -> bool,
|
||||
authors: BTreeSet<Did>,
|
||||
repository: &Repository,
|
||||
profile: &Profile,
|
||||
) -> anyhow::Result<()> {
|
||||
@@ -29,6 +32,11 @@ pub fn run(
|
||||
if !filter(patch.state()) {
|
||||
continue;
|
||||
}
|
||||
if !authors.is_empty() {
|
||||
if !authors.contains(patch.author().id()) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
all.push((id, patch));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user