[Bps-public-commit] r11361 - in SVN-PropDB: . lib/Prophet lib/Prophet/Resolver

jesse at bestpractical.com jesse at bestpractical.com
Tue Apr 1 22:15:27 EDT 2008


Author: jesse
Date: Tue Apr  1 22:15:27 2008
New Revision: 11361

Modified:
   SVN-PropDB/   (props changed)
   SVN-PropDB/lib/Prophet/Handle.pm
   SVN-PropDB/lib/Prophet/Resolver/AlwaysTarget.pm
   SVN-PropDB/lib/Prophet/Resolver/Failed.pm
   SVN-PropDB/lib/Prophet/Sync/Source.pm
   SVN-PropDB/lib/Prophet/Test.pm

Log:
 r28941 at 70-5-79-205:  jesse | 2008-04-01 16:14:41 -1000
 * conflicting sync tests


Modified: SVN-PropDB/lib/Prophet/Handle.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Handle.pm	(original)
+++ SVN-PropDB/lib/Prophet/Handle.pm	Tue Apr  1 22:15:27 2008
@@ -245,7 +245,8 @@
 
     my $file = $self->file_for( uuid => $args{uuid}, type => $args{type} );
     foreach my $prop ( keys %{ $args{'props'} } ) {
-        $self->current_edit->root->change_node_prop( $file, $prop, $args{'props'}->{$prop}, undef );
+        eval { $self->current_edit->root->change_node_prop( $file, $prop, $args{'props'}->{$prop}, undef )};
+        Carp::confess($@) if ($@);
     }
 }
 

Modified: SVN-PropDB/lib/Prophet/Resolver/AlwaysTarget.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Resolver/AlwaysTarget.pm	(original)
+++ SVN-PropDB/lib/Prophet/Resolver/AlwaysTarget.pm	Tue Apr  1 22:15:27 2008
@@ -5,21 +5,27 @@
 use base qw/Prophet::Resolver/;
 
 
-sub  run {
-    my $self = shift;
- my $conflicting_change = shift;
-            return 0 if $conflicting_change->file_op_conflict;
-
-            my $resolution = Prophet::Change->new_from_conflict( $conflicting_change );
-
-            for my $prop_change ( @{ $conflicting_change->prop_conflicts } ) {
-                $resolution->add_prop_change(
-                    name => $prop_change->name,
-                    old  => $prop_change->source_new_value,
-                    new  => $prop_change->target_value
-                );
-            }
-            return $resolution;
+sub run {
+    my $self               = shift;
+    my $conflicting_change = shift;
+    my $resolution         = Prophet::Change->new_from_conflict($conflicting_change);
+    if ( $conflicting_change->file_op_conflict eq 'update_missing_file' ) {
+        $resolution->change_type('delete');
+        return $resolution;
+    } elsif ( $conflicting_change->file_op_conflict eq 'delete_missing_file' ) {
+        return $resolution;
+    } elsif ( $conflicting_change->file_op_conflict ) {
+        die YAML::Dump($conflicting_change);
+    }
+
+    for my $prop_change ( @{ $conflicting_change->prop_conflicts } ) {
+        $resolution->add_prop_change(
+            name => $prop_change->name,
+            old  => $prop_change->source_new_value,
+            new  => $prop_change->target_value
+        );
+    }
+    return $resolution;
 }
 
 1;

Modified: SVN-PropDB/lib/Prophet/Resolver/Failed.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Resolver/Failed.pm	(original)
+++ SVN-PropDB/lib/Prophet/Resolver/Failed.pm	Tue Apr  1 22:15:27 2008
@@ -5,6 +5,10 @@
 use base qw/Prophet::Resolver/;
 
 sub run {
+    my $self = shift;
+    my $conflicting_change = shift;
+    my $conflict = shift;
+
     die "The resolution was not resolved. Sorry dude. (Once Prophet works, you should NEVER see this message)";
 }
 

Modified: SVN-PropDB/lib/Prophet/Sync/Source.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source.pm	Tue Apr  1 22:15:27 2008
@@ -56,6 +56,7 @@
             resolver_class          => { optional => 1 },
             conflict_callback => { optional => 1 } } );
 
+
     my $source = $args{'from'};
 
     my $resdb = $args{use_resdb} ?

Modified: SVN-PropDB/lib/Prophet/Test.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Test.pm	(original)
+++ SVN-PropDB/lib/Prophet/Test.pm	Tue Apr  1 22:15:27 2008
@@ -76,6 +76,7 @@
    @_ = sub {
       my ($ret, $stdout,$stderr) = (run_script($script, $args), $msg);
       @_ = ($ret,$msg);
+      diag($stderr);
       goto &Test::More::ok;
 };
     goto \&lives_and;



More information about the Bps-public-commit mailing list