[Bps-public-commit] Prophet branch, master, updated. 96e0bd8292a3c98d6fabda27cbe3290068d21366

jesse jesse at bestpractical.com
Wed May 27 14:48:47 EDT 2009


The branch, master has been updated
       via  96e0bd8292a3c98d6fabda27cbe3290068d21366 (commit)
      from  2afbf36512f3348299889d6f63a126d19e7ecbbb (commit)

Summary of changes:
 lib/Prophet/Replica.pm |   34 ++++++++++++++++++----------------
 1 files changed, 18 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit 96e0bd8292a3c98d6fabda27cbe3290068d21366
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Wed May 27 14:48:13 2009 -0400

    minor code reformatting, unifying two if() conditions that had the same
    block

diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index 3089771..6cd2145 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -263,32 +263,32 @@ sub integrate_changeset {
     # we'll want to skip or remove those changesets
 
 
-    if (   $changeset->is_resolution || $changeset->is_nullification || !$changeset->has_changes ) {
+    if (   $changeset->is_resolution
+        || $changeset->is_nullification
+        || !$changeset->has_changes
+        || $self->has_seen_changeset($changeset) ) {
+
         # if it's a changeset we don't care about, mark it as seen and move on
         $self->record_integration_of_changeset($changeset);
-        $args{'reporting_callback'}->( changeset => $changeset,
-           ) if ( $args{'reporting_callback'} );
-        return;
-
-    }  elsif ( $self->has_seen_changeset($changeset) ) {
-               $self->record_integration_of_changeset($changeset);
-        $args{'reporting_callback'}->( changeset => $changeset,
-           ) if ( $args{'reporting_callback'} );
+        $args{'reporting_callback'}->( changeset => $changeset, )
+            if ( $args{'reporting_callback'} );
         return;
-        }
-
+    }
     elsif ( my $conflict = $self->conflicts_from_changeset($changeset) ) {
-        $self->log_debug("Integrating conflicting changeset ".$changeset->original_sequence_no .  " from " . $self->display_name_for_uuid($changeset->original_source_uuid));
+        $self->log_debug( "Integrating conflicting changeset "
+                . $changeset->original_sequence_no
+                . " from "
+                . $self->display_name_for_uuid( $changeset->original_source_uuid ) );
         $args{conflict_callback}->($conflict) if $args{'conflict_callback'};
         $conflict->resolvers( [ sub { $args{resolver}->(@_) } ] ) if $args{resolver};
         if ( $args{resolver_class} ) {
-            Prophet::App->require($args{resolver_class}) || die $@;
+            Prophet::App->require( $args{resolver_class} ) || die $@;
             $conflict->resolvers(
                 [   sub {
                         $args{resolver_class}->new->run(@_);
                         }
                 ]
-                )
+            );
         }
         my $resolutions = $conflict->generate_resolution( $args{resdb} );
 
@@ -306,8 +306,10 @@ sub integrate_changeset {
         # integrate the conflict resolution change
         $self->record_resolutions( $conflict->resolution_changeset );
 
-        $args{'reporting_callback'}->( changeset => $changeset,
-            conflict => $conflict ) if ( $args{'reporting_callback'} );
+        $args{'reporting_callback'}->(
+            changeset => $changeset,
+            conflict  => $conflict
+        ) if ( $args{'reporting_callback'} );
         return 1;
     } else {
         $self->log_debug("Integrating changeset ".$changeset->original_sequence_no .

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



More information about the Bps-public-commit mailing list