]> git.donarmstrong.com Git - debbugs.git/commitdiff
accept status in addition to bugs in bug_filter
authorDon Armstrong <don@donarmstrong.com>
Fri, 1 Aug 2008 04:19:38 +0000 (21:19 -0700)
committerDon Armstrong <don@donarmstrong.com>
Fri, 1 Aug 2008 04:19:38 +0000 (21:19 -0700)
Debbugs/Bugs.pm

index 20e2fb76ceef7f9b1d03b0e98c9479f6e0fea10e..026fce66d3b1e3bc7c74564fcbe6ec4c35ae1267 100644 (file)
@@ -304,14 +304,16 @@ sub newest_bug {
 
 Allows filtering bugs on commonly used criteria
 
+
+
 =cut
 
 sub bug_filter {
      my %param = validate_with(params => \@_,
-                              spec   => {bug => {type  => SCALAR,
-                                                 regex => qr/^\d+$/,
-                                                },
-                                         status => {type => HASHREF,
+                              spec   => {bug    => {type => ARRAYREF|SCALAR,
+                                                    optional => 1,
+                                                   },
+                                         status => {type => HASHREF|ARRAYREF,
                                                     optional => 1,
                                                    },
                                          seen_merged => {type => HASHREF,
@@ -339,6 +341,9 @@ sub bug_filter {
         not defined $param{seen_merged}) {
          croak "repeat_merged false requires seen_merged to be passed";
      }
+     if (not exists $param{bug} and not exists $param{status}) {
+        croak "one of bug or status must be passed";
+     }
 
      if (not exists $param{status}) {
          my $location = getbuglocation($param{bug}, 'summary');