From: Don Armstrong Date: Sun, 17 Jun 2007 09:54:08 +0000 (+0100) Subject: * Allow archive=>both in get_bugs() to search both archived and X-Git-Tag: release/2.6.0~547^2~1 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=c86f6c6cad859483e79c04c49592791bbfe3fc67;p=debbugs.git * Allow archive=>both in get_bugs() to search both archived and unarchived bugs --- diff --git a/Debbugs/Bugs.pm b/Debbugs/Bugs.pm index 2399102..bb79313 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/^(.+)\:\:/;