From c86f6c6cad859483e79c04c49592791bbfe3fc67 Mon Sep 17 00:00:00 2001 From: Don Armstrong Date: Sun, 17 Jun 2007 10:54:08 +0100 Subject: [PATCH] * Allow archive=>both in get_bugs() to search both archived and unarchived bugs --- Debbugs/Bugs.pm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Debbugs/Bugs.pm b/Debbugs/Bugs.pm index 2399102d..bb793134 100644 --- a/Debbugs/Bugs.pm +++ b/Debbugs/Bugs.pm @@ -104,7 +104,8 @@ searches are performed. =over =item archive -- whether to search archived bugs or normal bugs; -defaults to false. +defaults to false. As a special case, if archive is 'both', but +archived and unarchived bugs are returned. =item usertags -- set of usertags and the bugs they are applied to @@ -180,7 +181,7 @@ sub get_bugs{ bugs => {type => SCALAR|ARRAYREF, optional => 1, }, - archive => {type => BOOLEAN, + archive => {type => BOOLEAN|SCALAR, default => 0, }, usertags => {type => HASHREF, @@ -192,6 +193,13 @@ sub get_bugs{ # Normalize options my %options = %param; my @bugs; + if ($options{archive} eq 'both') { + push @bugs, get_bugs(%options,archive=>0); + push @bugs, get_bugs(%options,archive=>1); + my %bugs; + @bugs{@bugs} = @bugs; + return keys %bugs; + } # A configuration option will set an array that we'll use here instead. for my $routine (qw(Debbugs::Bugs::get_bugs_by_idx Debbugs::Bugs::get_bugs_flatfile)) { my ($package) = $routine =~ m/^(.+)\:\:/; -- 2.39.5