[Bps-public-commit] r11286 - in SVN-PropDB: bin t

clkao at bestpractical.com clkao at bestpractical.com
Sun Mar 30 23:58:33 EDT 2008


Author: clkao
Date: Sun Mar 30 23:58:32 2008
New Revision: 11286

Modified:
   SVN-PropDB/bin/prophet-merge
   SVN-PropDB/lib/Prophet/Conflict.pm
   SVN-PropDB/lib/Prophet/Record.pm
   SVN-PropDB/t/simple-conflicting-merge.t

Log:
do the object checking outside the conflict callback.

Modified: SVN-PropDB/bin/prophet-merge
==============================================================================
--- SVN-PropDB/bin/prophet-merge	(original)
+++ SVN-PropDB/bin/prophet-merge	Sun Mar 30 23:58:32 2008
@@ -16,16 +16,16 @@
 my $target = Prophet::Sync::Source->new( { url => $opts->{'to'} } );
 
 if ( $target->uuid eq $source->uuid ) {
-    fatal_error( "You appear to be trying to merge two identical replicas. "
-            . "Either you're trying to merge a replica to itself or "
-            . "someone did a bad job cloning your database" );
+fatal_error( "You appear to be trying to merge two identical replicas. "
+        . "Either you're trying to merge a replica to itself or "
+        . "someone did a bad job cloning your database" );
 }
 
 if ( !$target->accepts_changesets ) {
-    fatal_error( $target->url . " does not accept changesets. Perhaps it's unwritable or something" );
+fatal_error( $target->url . " does not accept changesets. Perhaps it's unwritable or something" );
 }
 
-$target->import_changesets( from => $source);
+$target->import_changesets( from => $source );
 
 exit(0);
 

Modified: SVN-PropDB/lib/Prophet/Conflict.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Conflict.pm	(original)
+++ SVN-PropDB/lib/Prophet/Conflict.pm	Sun Mar 30 23:58:32 2008
@@ -25,8 +25,6 @@
     $self->generate_changeset_conflicts($changeset);
     return unless (@{$self->conflicting_changes});
 
-    use Data::Dumper;
-    warn Dumper($self->conflicting_changes) if @{$self->conflicting_changes};
     $self->generate_nullification_changeset;
     $self->attempt_automatic_conflict_resolution;
 

Modified: SVN-PropDB/lib/Prophet/Record.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Record.pm	(original)
+++ SVN-PropDB/lib/Prophet/Record.pm	Sun Mar 30 23:58:32 2008
@@ -72,7 +72,7 @@
 =cut
 
 
-sub load {
+    sub load {
     my $self = shift;
     my %args = validate(@_, { uuid => 1});
     $self->uuid($args{uuid});

Modified: SVN-PropDB/t/simple-conflicting-merge.t
==============================================================================
--- SVN-PropDB/t/simple-conflicting-merge.t	(original)
+++ SVN-PropDB/t/simple-conflicting-merge.t	Sun Mar 30 23:58:32 2008
@@ -53,10 +53,16 @@
     my $source = Prophet::Sync::Source->new( { url => repo_uri_for('alice') } );
     my $target = Prophet::Sync::Source->new( { url => repo_uri_for('bob')} );
 
+    my $conflict_obj;
+
     eval {
-    $target->import_changesets( from => $source , conflict_callback=> sub { 
-    
-    my $conflict_obj = shift;
+        $target->import_changesets(
+            from              => $source,
+            conflict_callback => sub {
+                $conflict_obj = shift; die }
+        );
+    };
+
     isa_ok($conflict_obj, 'Prophet::Conflict');
 
     my @conflicting_changes = @{$conflict_obj->conflicting_changes};
@@ -72,10 +78,7 @@
     is($c->source_old_value, 'new');
     is($c->source_new_value,'stalled');
     is($c->target_value,'stalled');
-    die;
 
- });
-    }; 
     # Throw away the return. we wanted to inspect the conflict but not apply anything
 
 



More information about the Bps-public-commit mailing list