[Bps-public-commit] r14138 - in Prophet/trunk: . lib/Prophet/Replica lib/Prophet/Resolver lib/Prophet/Test

sartak at bestpractical.com sartak at bestpractical.com
Tue Jul 15 21:34:54 EDT 2008


Author: sartak
Date: Tue Jul 15 21:34:27 2008
New Revision: 14138

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/ForeignReplica.pm
   Prophet/trunk/lib/Prophet/Replica.pm
   Prophet/trunk/lib/Prophet/Replica/Native.pm
   Prophet/trunk/lib/Prophet/Replica/SVN.pm
   Prophet/trunk/lib/Prophet/ReplicaExporter.pm
   Prophet/trunk/lib/Prophet/Resolver/AlwaysTarget.pm
   Prophet/trunk/lib/Prophet/Resolver/Failed.pm
   Prophet/trunk/lib/Prophet/Test.pm
   Prophet/trunk/lib/Prophet/Test/Arena.pm

Log:
 r64343 at onn:  sartak | 2008-07-15 21:33:28 -0400
 Error cleanup


Modified: Prophet/trunk/lib/Prophet/ForeignReplica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ForeignReplica.pm	(original)
+++ Prophet/trunk/lib/Prophet/ForeignReplica.pm	Tue Jul 15 21:34:27 2008
@@ -30,7 +30,7 @@
 sub conflicts_from_changeset { return; }
 sub can_write_changesets     {1}
 
-sub record_resolutions { die "resolution handling is not for foreign replicas" }
+sub record_resolutions { die "Resolution handling is not for foreign replicas" }
 
 sub import_resolutions_from_remote_source {
     warn 'resdb not implemented yet';

Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica.pm	Tue Jul 15 21:34:27 2008
@@ -160,7 +160,7 @@
 
     $self->resolution_db_handle->import_changesets(
         from     => $source->resolution_db_handle,
-        resolver => sub { die "nono not yet" }
+        resolver => sub { die "not implemented yet" }
 
     );
 }
@@ -654,9 +654,8 @@
 =cut
 
 sub traverse_changesets {
-
-    Carp::confess "Someone has failed to implement a 'traverse_changesets' method for their replica type.";
-
+    my $class = blessed($_[0]);
+    Carp::confess "$class has failed to implement a 'traverse_changesets' method for their replica type.";
 
 }
 =head2  can_write_changesets
@@ -782,7 +781,7 @@
         $self->log("delete_file: " .$change->record_type. " " .$change->record_uuid);
         $self->delete_record( type => $change->record_type, uuid => $change->record_uuid);
     } else {
-        Carp::confess( " I have never heard of the change type: " . $change->change_type );
+        Carp::confess( "Unknown change type: " . $change->change_type );
     }
 
 }

Modified: Prophet/trunk/lib/Prophet/Replica/Native.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/Native.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/Native.pm	Tue Jul 15 21:34:27 2008
@@ -104,10 +104,7 @@
         $self->initialize();
 
     } else {
-        die
-            "We can only create file: based prophet replicas. It looks like you're trying to create "
-            . $self->url;
-
+        die "We can only create file: based prophet replicas. It looks like you're trying to create " . $self->url;
     }
 
 }

Modified: Prophet/trunk/lib/Prophet/Replica/SVN.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN.pm	(original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN.pm	Tue Jul 15 21:34:27 2008
@@ -116,7 +116,7 @@
     my $last_rev = $self->latest_sequence_no();
 
 
-    die "you must implement latest_sequence_no in " . ref($self) . ", or override traverse_changesets"
+    die "You must implement latest_sequence_no in " . blessed($self) . ", or override traverse_changesets"
         unless defined $last_rev;
 
     for my $rev ( $first_rev .. $self->latest_sequence_no ) {

Modified: Prophet/trunk/lib/Prophet/ReplicaExporter.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/ReplicaExporter.pm	(original)
+++ Prophet/trunk/lib/Prophet/ReplicaExporter.pm	Tue Jul 15 21:34:27 2008
@@ -21,7 +21,7 @@
     lazy    => 1,
     default => sub {
         my $self = shift;
-        confess "No target_path specified." unless $self->has_target_path;
+        confess "No target_path specified" unless $self->has_target_path;
         my $replica = Prophet::Replica->new({url => "prophet:file://" . $self->target_path});
         $replica->initialize;
         return $replica;

Modified: Prophet/trunk/lib/Prophet/Resolver/AlwaysTarget.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Resolver/AlwaysTarget.pm	(original)
+++ Prophet/trunk/lib/Prophet/Resolver/AlwaysTarget.pm	Tue Jul 15 21:34:27 2008
@@ -15,7 +15,7 @@
     } elsif ( $file_op_conflict eq 'delete_missing_file' ) {
         return $resolution;
     } elsif ( $file_op_conflict ) {
-        die Dumper($conflict,$conflicting_change);
+        die "Unknown file_op_conflict $file_op_conflict: " . Dumper($conflict,$conflicting_change);
     }
 
     for my $prop_change ( @{ $conflicting_change->prop_conflicts } ) {

Modified: Prophet/trunk/lib/Prophet/Resolver/Failed.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Resolver/Failed.pm	(original)
+++ Prophet/trunk/lib/Prophet/Resolver/Failed.pm	Tue Jul 15 21:34:27 2008
@@ -9,7 +9,7 @@
     my $conflict           = shift;
 
     die
-        " The resolution was not resolved. Sorry dude. (Once Prophet works, you should NEVER see this message)"
+        "The conflict was not resolved! Sorry dude."
         . Dumper($conflict, $conflicting_change);
 
 }

Modified: Prophet/trunk/lib/Prophet/Test.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test.pm	(original)
+++ Prophet/trunk/lib/Prophet/Test.pm	Tue Jul 15 21:34:27 2008
@@ -63,10 +63,9 @@
     my $types;
     eval { require Devel::Gladiator; };
     if ($@) {
+        warn 'Get Devel::Gladiator from http://code.sixapart.com/svn/Devel-Gladiator/trunk/ and harass sky at crucially.net to CPAN it';
         return $code->();
-        die
-        'Get Devel::Gladiator from http://code.sixapart.com/svn/Devel-Gladiator/trunk/ and harass sky at crucially.net to CPAN it';
-    } 
+    }
     for ( @{ Devel::Gladiator::walk_arena() } ) {
         $types->{ ref($_) }--;
     }

Modified: Prophet/trunk/lib/Prophet/Test/Arena.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Test/Arena.pm	(original)
+++ Prophet/trunk/lib/Prophet/Test/Arena.pm	Tue Jul 15 21:34:27 2008
@@ -120,7 +120,7 @@
         diag(" as ".$chicken->name. ": $step_display");
         # walk the arena, noting the type of each value
         as_user( $chicken->name, sub { $chicken->take_one_step($step_name) } );
-        die if ( grep { !$_ } $TB->summary );
+        die "We failed some tests; aborting" if grep { !$_ } $TB->summary;
 
     }
 



More information about the Bps-public-commit mailing list