[Bps-public-commit] SD branch, master, updated. 0.70-52-g9a2896e

sunnavy at bestpractical.com sunnavy at bestpractical.com
Tue Sep 8 21:07:00 EDT 2009


The branch, master has been updated
       via  9a2896ec0243179d0c4c4a91e74b484eee25a5db (commit)
       via  b34d29e3257a400b44686ea9c78eaccf91161e41 (commit)
       via  300ef67c93bc858c077d96c35950e9255cc6e405 (commit)
      from  642968b1136e4945ccede9ce64d90a84470cd611 (commit)

Summary of changes:
 lib/App/SD/Replica/lighthouse.pm             |   10 ++++++----
 lib/App/SD/Replica/lighthouse/PullEncoder.pm |    9 ++++-----
 2 files changed, 10 insertions(+), 9 deletions(-)

- Log -----------------------------------------------------------------
commit 300ef67c93bc858c077d96c35950e9255cc6e405
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Sep 7 17:00:06 2009 +0800

    update lighthouse replica: use auth; versions and attachments can return array

diff --git a/lib/App/SD/Replica/lighthouse.pm b/lib/App/SD/Replica/lighthouse.pm
index 07d4d33..79568fb 100644
--- a/lib/App/SD/Replica/lighthouse.pm
+++ b/lib/App/SD/Replica/lighthouse.pm
@@ -69,8 +69,10 @@ sub BUILD {
     $self->project( $project );
 
     my $lighthouse = Net::Lighthouse::Project->new(
-        $email ? ( email => $email, password => $password ) : (),
-        $token ? ( token => $token ) : (),
+        auth => {
+            $email ? ( email => $email, password => $password ) : (),
+            $token ? ( token => $token ) : (),
+        },
         account => $account,
     );
     $lighthouse->load( $project );
@@ -91,7 +93,7 @@ sub get_txn_list_by_date {
             creator => $_->creator_name,
             created => $_->created_at->epoch,
         }
-    } @{ $ticket_obj->versions };
+    } $ticket_obj->versions;
 
     if ( $ticket_obj->attachments ) {
         my $user = Net::Lighthouse::User->new(
@@ -99,7 +101,7 @@ sub get_txn_list_by_date {
               grep { $self->sync_source->lighthouse->$_ }
               qw/account email password token/
         );
-        for my $att ( @{ $ticket_obj->attachments } ) {
+        for my $att ( $ticket_obj->attachments ) {
             $user->load( $att->uploader_id );
             push @txns,
               {
diff --git a/lib/App/SD/Replica/lighthouse/PullEncoder.pm b/lib/App/SD/Replica/lighthouse/PullEncoder.pm
index 21e780f..318e98c 100644
--- a/lib/App/SD/Replica/lighthouse/PullEncoder.pm
+++ b/lib/App/SD/Replica/lighthouse/PullEncoder.pm
@@ -71,8 +71,8 @@ sub find_matching_transactions {
     my $sequence = 0;
     # hack, let's add sequence for comments
     my @raw_versions =
-      map { $_->{sequence} = $sequence++; $_ } @{ $args{ticket}->versions };
-    my @raw_attachments = @{ $args{ticket}->attachments|| [] };
+      map { $_->{sequence} = $sequence++; $_ } $args{ticket}->versions;
+    my @raw_attachments = $args{ticket}->attachments;
 
     my @raw_txns = ( @raw_versions, @raw_attachments );
     my @txns;
@@ -256,8 +256,7 @@ sub transcode_one_txn {
                         my $user = Net::Lighthouse::User->new(
                             map { $_ => $self->sync_source->lighthouse->$_ }
                               grep { $self->sync_source->lighthouse->$_ }
-                              qw/account
-                              email password token/
+                              qw/account auth/
                         );
                         eval { $user->load($old) };
                         if ($@) {
@@ -397,7 +396,7 @@ sub resolve_user_id_to {
         my $user = Net::Lighthouse::User->new(
             map { $_ => $self->sync_source->lighthouse->$_ }
               grep { $self->sync_source->lighthouse->$_ }
-              qw/account email password token/
+              qw/account auth/
         );
         $user->load( $id );
         return $user->name;

commit b34d29e3257a400b44686ea9c78eaccf91161e41
Merge: 300ef67 2b7c577
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Mon Sep 7 17:00:22 2009 +0800

    Merge branch 'master' of code.bestpractical.com:/git/sd


commit 9a2896ec0243179d0c4c4a91e74b484eee25a5db
Merge: b34d29e 642968b
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Sep 9 09:06:39 2009 +0800

    Merge branch 'master' of code.bestpractical.com:/git/sd


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



More information about the Bps-public-commit mailing list