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

sartak at bestpractical.com sartak at bestpractical.com
Sat Aug 9 12:43:23 EDT 2008


Author: sartak
Date: Sat Aug  9 12:43:22 2008
New Revision: 14943

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

Log:
 r69002 at onn:  sartak | 2008-08-09 12:43:01 -0400
 Include a "change_filter" in ChangeSet->as_string (to allow showing only changes to a particular record)


Modified: Prophet/trunk/lib/Prophet/ChangeSet.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ChangeSet.pm	(original)
+++ Prophet/trunk/lib/Prophet/ChangeSet.pm	Sat Aug  9 12:43:22 2008
@@ -162,6 +162,12 @@
 
 sub as_string {
     my $self = shift;
+    my %args = validate(@_, {
+        change_filter => 0,
+    });
+
+    my $change_filter = $args{change_filter};
+
     my $out = '';
 
     $out .= "Changeset "
@@ -177,6 +183,10 @@
         my @prop_changes = $change->prop_changes;
         next if @prop_changes == 0;
 
+        if ($change_filter) {
+            next unless $change_filter->($change);
+        }
+
         for my $prop_change (@prop_changes) {
             $out .= "  " . $prop_change->summary . "\n";
         }



More information about the Bps-public-commit mailing list