[Bps-public-commit] SD branch, master, updated. 21e9cc18777b167ed489a3d0511442ba0b27d452
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Mon Jun 1 22:03:55 EDT 2009
The branch, master has been updated
via 21e9cc18777b167ed489a3d0511442ba0b27d452 (commit)
from 1dc867e58a83547a7210b5de0bd49607730f508a (commit)
Summary of changes:
lib/App/SD/Replica/trac.pm | 25 +++++++++++++++++++------
1 files changed, 19 insertions(+), 6 deletions(-)
- Log -----------------------------------------------------------------
commit 21e9cc18777b167ed489a3d0511442ba0b27d452
Author: sunnavy <sunnavy at gmail.com>
Date: Tue Jun 2 10:03:33 2009 +0800
try to get resolution list for trac
diff --git a/lib/App/SD/Replica/trac.pm b/lib/App/SD/Replica/trac.pm
index 08d57d3..ad9031c 100644
--- a/lib/App/SD/Replica/trac.pm
+++ b/lib/App/SD/Replica/trac.pm
@@ -41,7 +41,7 @@ sub BUILD {
Net::Trac::Connection->new(
url => $self->remote_url,
user => $username,
- password => $password
+ password => $password,
)
);
$self->trac->ensure_logged_in;
@@ -85,12 +85,25 @@ sub remote_uri_path_for_id {
sub database_settings {
my $self = shift;
+
+ my @resolutions;
+ use Net::Trac::TicketSearch;
+ my $search = Net::Trac::TicketSearch->new( connection => $self->trac );
+ # find an active ticket to get resolution list
+ $search->limit(1);
+ $search->query( status => [ qw/accepted assigned reopened new/ ] );
+ my $result = $search->results->[0];
+ if ( $result ) {
+ $result->_fetch_update_ticket_metadata;
+ @resolutions = @{$result->valid_resolutions};
+ }
+ else {
+ @resolutions = qw/fixed invalid wontfix duplicate
+ worksforme/;
+ }
return {
- active_statuses => [qw/new accepted/],
- statuses => [
- qw/new accepted fixed invalid wontfix duplicate
- worksforme/
- ],
+ active_statuses => [qw/new accepted assigned reopened/],
+ statuses => [ qw/new accepted assigned reopened/, @resolutions, ],
};
}
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list