[Bps-public-commit] SD branch, master, updated. 0.74-76-g97412a8

Christine Spang spang at bestpractical.com
Mon Feb 21 09:54:42 EST 2011


The branch, master has been updated
       via  97412a897ecc0708e9307a2fff6c7950334cfd5f (commit)
       via  d94418371516028ff7dacf4b066893e530aa2059 (commit)
      from  075fac40b884fe7a33b62edeb3b58f27e4038717 (commit)

Summary of changes:
 lib/App/SD/Replica/hm/PullEncoder.pm |   13 +++++++------
 lib/App/SD/Util.pm                   |    3 +++
 2 files changed, 10 insertions(+), 6 deletions(-)

- Log -----------------------------------------------------------------
commit d94418371516028ff7dacf4b066893e530aa2059
Author: Christine Spang <christine at debian.org>
Date:   Mon Feb 21 09:35:41 2011 -0500

    fix cloning from hiveminder (RT #64693)
    
    trs++ for reporting

diff --git a/lib/App/SD/Replica/hm/PullEncoder.pm b/lib/App/SD/Replica/hm/PullEncoder.pm
index a88bb19..7b758c6 100644
--- a/lib/App/SD/Replica/hm/PullEncoder.pm
+++ b/lib/App/SD/Replica/hm/PullEncoder.pm
@@ -121,9 +121,9 @@ sub add_prop_change {
     my %args = validate( @_, { history_entry => 1, previous_state => 1, change => 1 } );
 
 
-    my $field = $args{'history_entry'}{'field'} ||'';
-    my $old   = $args{'history_entry'}{'old_value'} ||'';
-    my $new   = $args{'history_entry'}{'new_value'} ||'';
+    my $field = qq{$args{'history_entry'}{'field'}} ||'';
+    my $old   = qq{$args{'history_entry'}{'old_value'}} ||'';
+    my $new   = qq{$args{'history_entry'}{'new_value'}} ||'';
 
     if ( $args{'previous_state'}->{$field} eq $new ) {
         $args{'previous_state'}->{$field} = $old;
@@ -197,8 +197,8 @@ sub translate_props {
             }
 
             if ($prop->name =~ /^(?:due|completed_at|created_at)$/) {
-                $prop->old_value(App::SD::Util::string_to_datetime($prop->old_value));
-                $prop->new_value(App::SD::Util::string_to_datetime($prop->new_value));
+                $prop->old_value(App::SD::Util::string_to_datetime($prop->old_value)."");
+                $prop->new_value(App::SD::Util::string_to_datetime($prop->new_value)."");
 
              }
 

commit 97412a897ecc0708e9307a2fff6c7950334cfd5f
Author: Christine Spang <christine at debian.org>
Date:   Mon Feb 21 09:44:11 2011 -0500

    clean up hm sync messages

diff --git a/lib/App/SD/Replica/hm/PullEncoder.pm b/lib/App/SD/Replica/hm/PullEncoder.pm
index 7b758c6..44a3395 100644
--- a/lib/App/SD/Replica/hm/PullEncoder.pm
+++ b/lib/App/SD/Replica/hm/PullEncoder.pm
@@ -120,7 +120,7 @@ sub add_prop_change {
     my $self = shift;
     my %args = validate( @_, { history_entry => 1, previous_state => 1, change => 1 } );
 
-
+    no warnings 'uninitialized';
     my $field = qq{$args{'history_entry'}{'field'}} ||'';
     my $old   = qq{$args{'history_entry'}{'old_value'}} ||'';
     my $new   = qq{$args{'history_entry'}{'new_value'}} ||'';
@@ -197,6 +197,7 @@ sub translate_props {
             }
 
             if ($prop->name =~ /^(?:due|completed_at|created_at)$/) {
+                no warnings 'uninitialized';
                 $prop->old_value(App::SD::Util::string_to_datetime($prop->old_value)."");
                 $prop->new_value(App::SD::Util::string_to_datetime($prop->new_value)."");
 
diff --git a/lib/App/SD/Util.pm b/lib/App/SD/Util.pm
index b459b5f..ea0cac2 100644
--- a/lib/App/SD/Util.pm
+++ b/lib/App/SD/Util.pm
@@ -9,6 +9,9 @@ my %MONTHS = ( jan => 1, feb => 2, mar => 3, apr => 4, may => 5, jun => 6, jul =
 
 sub string_to_datetime {
     my ($date)= validate_pos(@_, { type => SCALAR | UNDEF} );
+
+    return unless defined($date);
+
     if ($date =~ /^(\d{4})-(\d{2})-(\d{2})[T\s](\d{1,2}):(\d{2}):(\d{2})Z?$/ ){
         my ($year,$month,$day, $hour,$min,$sec) = ($1,$2,$3,$4,$5,$6);
         my $dt = DateTime->new( year => $year,

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



More information about the Bps-public-commit mailing list