[Bps-public-commit] SD branch, master, updated. d9d5d205e9af1d2a01aa5e3c9dfa619d2f7ce20e

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Jul 7 04:30:30 EDT 2009


The branch, master has been updated
       via  d9d5d205e9af1d2a01aa5e3c9dfa619d2f7ce20e (commit)
       via  7cafd88b8c9268c2f1cba4c2fc839176281e94dd (commit)
      from  15aafc4ae55bb6f8d32455102cf6342953427e17 (commit)

Summary of changes:
 lib/App/SD/Replica/gcode.pm |   28 ++++++++++++++++++++++------
 1 files changed, 22 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit 7cafd88b8c9268c2f1cba4c2fc839176281e94dd
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 7 15:59:21 2009 +0800

    ask pawwrod if find userinfo in uri

diff --git a/lib/App/SD/Replica/gcode.pm b/lib/App/SD/Replica/gcode.pm
index 08faa5e..fccf43d 100644
--- a/lib/App/SD/Replica/gcode.pm
+++ b/lib/App/SD/Replica/gcode.pm
@@ -39,11 +39,17 @@ sub BUILD {
     # Require rather than use to defer load
     require Net::Google::Code;
 
-    my (  $project ) = $self->{url} =~ m/^gcode:(.*?)$/
-        or die "Can't parse Google::Code server spec. Expected gcode:k9mail";
+    my ( $userinfo, $project ) = $self->{url} =~ m/^gcode:(.*@)?(.*?)$/
+        or die "Can't parse Google::Code server spec. Expected gcode:user:password\@k9mail";
     $self->project($project);
+    my ( $email, $password );
+    # ask password only if there is userinfo but not password
+    if ( $userinfo ) {
+        $userinfo =~ s/\@$//;
+        ( $email, $password ) = split /:/, $userinfo;
+        ( undef, $password ) = $self->prompt_for_login( "gcode:$project", $email ) unless $password;
+    }
 
-    #( $username, $password ) = $self->prompt_for_login( $uri, $username ) unless $password;
     $self->gcode( Net::Google::Code->new( project => $self->project));
     $self->gcode->load();
 }
@@ -95,11 +101,15 @@ sub database_settings {
     $issue->load_predefined;
     my $status = $issue->predefined_status;
     return {
-        active_statuses => [ map { lc } @{ $status->{open} } ],
-        statuses => [ map { lc } @{ $status->{open} }, @{ $status->{closed} } ],
         project_name => $self->project,
+        $status
+        ? (
+            active_statuses => [ map { lc } @{ $status->{open} } ],
+            statuses =>
+              [ map { lc } @{ $status->{open} }, @{ $status->{closed} } ]
+          )
+        : (),
     };
-
 }
 
 __PACKAGE__->meta->make_immutable;

commit d9d5d205e9af1d2a01aa5e3c9dfa619d2f7ce20e
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Tue Jul 7 16:16:58 2009 +0800

    default status for gcode

diff --git a/lib/App/SD/Replica/gcode.pm b/lib/App/SD/Replica/gcode.pm
index fccf43d..90a1974 100644
--- a/lib/App/SD/Replica/gcode.pm
+++ b/lib/App/SD/Replica/gcode.pm
@@ -108,7 +108,13 @@ sub database_settings {
             statuses =>
               [ map { lc } @{ $status->{open} }, @{ $status->{closed} } ]
           )
-        : (),
+        : (
+            active_statuses => [qw/new accepted started/],
+            statuses        => [
+                qw/new accepted started duplicate fixed verified
+                  invalid wontfix done/
+            ],
+        ),
     };
 }
 

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list