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

jesse at bestpractical.com jesse at bestpractical.com
Thu Aug 28 21:16:39 EDT 2008


Author: jesse
Date: Thu Aug 28 21:16:37 2008
New Revision: 15624

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

Log:
 r44649 at 68-246-110-196 (orig r15572):  jesse | 2008-08-27 18:18:32 -0700
  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/trunk/lib/Prophet/Change.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Change.pm	(original)
+++ Prophet/trunk/lib/Prophet/Change.pm	Thu Aug 28 21:16:37 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/trunk/lib/Prophet/ChangeSet.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ChangeSet.pm	(original)
+++ Prophet/trunk/lib/Prophet/ChangeSet.pm	Thu Aug 28 21:16:37 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