[Bps-public-commit] r15572 - in Prophet/branches/Prophet-trunk: .

jesse at bestpractical.com jesse at bestpractical.com
Wed Aug 27 21:18:38 EDT 2008


Author: jesse
Date: Wed Aug 27 21:18:32 2008
New Revision: 15572

Modified:
   Prophet/branches/Prophet-trunk/   (props changed)
   Prophet/branches/Prophet-trunk/lib/Prophet/Change.pm
   Prophet/branches/Prophet-trunk/lib/Prophet/ChangeSet.pm

Log:
 r44635 at 192:  jesse | 2008-08-27 16:40:45 -0700
 * makde it possible to not report cangesets we don'twant to see in logging


Modified: Prophet/branches/Prophet-trunk/lib/Prophet/Change.pm
==============================================================================
--- Prophet/branches/Prophet-trunk/lib/Prophet/Change.pm	(original)
+++ Prophet/branches/Prophet-trunk/lib/Prophet/Change.pm	Wed Aug 27 21:18:32 2008
@@ -126,7 +126,7 @@
     my %args         = validate( @_, { header_callback => 0, } );
     my $out          = "";
     my @prop_changes = $self->prop_changes;
-    next if @prop_changes == 0;
+    return undef if @prop_changes == 0;
     $out .= $args{header_callback}->($self) if ( $args{header_callback} );
 
     for my $prop_change (@prop_changes) {

Modified: Prophet/branches/Prophet-trunk/lib/Prophet/ChangeSet.pm
==============================================================================
--- Prophet/branches/Prophet-trunk/lib/Prophet/ChangeSet.pm	(original)
+++ Prophet/branches/Prophet-trunk/lib/Prophet/ChangeSet.pm	Wed Aug 27 21:18:32 2008
@@ -166,20 +166,24 @@
         @_,
         {   change_filter => 0,
             change_header => 0,
-            header_callback => 0
+            header_callback => 0,
+            skip_empty => 0
         }
     );
 
-
-    my $out = $args{header_callback} ? $args{header_callback}->($self) :  $self->description_as_string;
+    
+    my $body = '';
 
     for my $change ( $self->changes ) {
         next if $args{change_filter} && !$args{change_filter}->($change);
-        $out .= $change->as_string( header_callback => $args{change_header} );
-        $out .= "\n";
+        $body .= $change->as_string( header_callback => $args{change_header} );
+        $body .= "\n";
     }
 
-    $out .= "\n";
+    return '' if !$body && $args{'skip_empty'};
+
+    my $header  = $args{header_callback} ? $args{header_callback}->($self) :  $self->description_as_string;
+    my $out  = $header ."\n".$body."\n";
     return $out;
 }
 



More information about the Bps-public-commit mailing list