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

jesse at bestpractical.com jesse at bestpractical.com
Sun Mar 30 21:16:29 EDT 2008


Author: jesse
Date: Sun Mar 30 21:16:29 2008
New Revision: 11283

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

Log:
 r28819 at 70-5-79-37:  jesse | 2008-03-30 15:16:19 -1000
  * cleanup


Modified: SVN-PropDB/lib/Prophet/Handle.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Handle.pm	(original)
+++ SVN-PropDB/lib/Prophet/Handle.pm	Sun Mar 30 21:16:29 2008
@@ -126,13 +126,12 @@
     my $self = shift;
     my $change = shift;
 
-    $self->current_edit->change_prop( 'prophet:original-source'  => $change->original_source_uuid  ||$change->source_uuid );
-    $self->current_edit->change_prop( 'prophet:original-sequence-no'  => $change->original_sequence_no  ||$change->sequence_no);
+    $self->current_edit->change_prop( 'prophet:original-source'  => $change->original_source_uuid   );
+    $self->current_edit->change_prop( 'prophet:original-sequence-no'  => $change->original_sequence_no);  
 }
 
 
 
-
 sub _integrate_change {
     my $self   = shift;
     my $change = shift;
@@ -318,19 +317,7 @@
 
 our $MERGETICKET_METATYPE = '_merge_tickets';
 
-=head2 last_changeset_from_source L<Prophet::Sync::Source>
-
-Given a L<Prophet::Sync::Source>, returns the last changeset sequence number we've seen from that remote source's UUID.
-
-=cut
 
-sub last_changeset_from_source {
-    my $self = shift;
-    my ($source)  = validate_pos( @_, { isa => 'Prophet::Sync::Source' } );
-    my $props = eval {$self->get_node_props(uuid => $source->uuid, type => $MERGETICKET_METATYPE)};
-    return $props->{'last-changeset'};
-
-}
 
 =head2 record_changeset_integration L<Prophet::ChangeSet>
 

Modified: SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	(original)
+++ SVN-PropDB/lib/Prophet/Sync/Source/SVN.pm	Sun Mar 30 21:16:29 2008
@@ -264,25 +264,22 @@
 }
 
 
-# XXX TODO this is hacky as hell and violates abstraction barriers in the name of doing things over the RA
 
 =head2 last_changeset_from_source $SOURCE_UUID
 
 Returns the last changeset id seen from the source identified by $SOURCE_UUID
 
-# XXX TODO, we need to move the code from handle here entirely
-
 =cut
 
 sub last_changeset_from_source {
     my $self = shift;
-    # XXX TODO should htis be an object rather than a uuid?
-    my ($source) = validate_pos(@_, {type => SCALAR } );
+        my ($source) = validate_pos(@_, {type => SCALAR } );
     my ( $stream, $pool );
 
-    # XXX HACK
     my $filename = join( "/", "_prophet", $Prophet::Handle::MERGETICKET_METATYPE, $source );
     my ( $rev_fetched, $props ) = eval { $self->ra->get_file( $filename, $self->ra->get_latest_revnum, $stream, $pool ); };
+    # XXX TODO this is hacky as hell and violates abstraction barriers in the name of doing things over the RA
+    # because we want to be able to sync to a remote replica someday.
 
     return ( $props->{'last-changeset'} ||0 );
 

Modified: SVN-PropDB/lib/Prophet/Test.pm
==============================================================================
--- SVN-PropDB/lib/Prophet/Test.pm	(original)
+++ SVN-PropDB/lib/Prophet/Test.pm	Sun Mar 30 21:16:29 2008
@@ -2,7 +2,7 @@
 use warnings;
 package Prophet::Test;
 use base qw/Test::More Exporter/;
-our @EXPORT = qw/diag as_alice as_bob as_charlie as_david run_ok repo_uri_for run_script run_output_matches replica_last_rev replica_merge_tickets replica_uuid_for/;
+our @EXPORT = qw/as_alice as_bob as_charlie as_david run_ok repo_uri_for run_script run_output_matches replica_last_rev replica_merge_tickets replica_uuid_for/;
 
 use File::Path 'rmtree';
 use File::Temp qw/tempdir/;
@@ -32,12 +32,14 @@
 }
 
 
-*old_diag = \&Test::More::diag;
 { no warnings 'redefine';
 sub Test::More::diag { # bad bad bad # convenient convenient convenient
- old_diag(@_) if $ENV{'TEST_VERBOSE'};
+   # my $tb = Test::More->builder;
+
+Test::More->builder->diag(@_) if ( $Test::Harness::Verbose || $ENV{'TEST_VERBOSE'});
 }
 }
+
 =head2 run_script SCRIPT_NAME [@ARGS]
 
 Runs the script SCRIPT_NAME as a perl script, setting the @INC to the same as our caller
@@ -49,8 +51,7 @@
     my $script = shift;
     my $args = shift;
     my ($stdout, $stderr);
-    my @cmd = ($^X, (map { "-I$_" } @INC), 'bin/'.$script);
-
+    my @cmd = _get_perl_cmd($script);
     my $ret = run3 [@cmd, @$args], undef, \$stdout, \$stderr;
     Carp::croak $stderr if $?;
     return($ret, $stdout, $stderr);
@@ -105,11 +106,19 @@
 
 =cut
 
+sub _get_perl_cmd {
+    my $script = shift;
+    my @cmd = ($^X, (map { "-I$_" } @INC));
+    push @cmd, '-MDevel::Cover' if $INC{'Devel/Cover.pm'};
+    push @cmd, 'bin/'.$script;
+    return @cmd;
+}
+
 sub is_script_output {
     my ($script, $arg, $exp_stdout, $exp_stderr, $msg) = @_;
     my $stdout_err = [];
     $exp_stderr ||= [];
-    my @cmd = ($^X, (map { "-I$_" } @INC), 'bin/'.$script);
+    my @cmd = _get_perl_cmd($script);
 
     my $ret = run3 [@cmd, @$arg], undef,
 	_mk_cmp_closure($exp_stdout, $stdout_err), # stdout



More information about the Bps-public-commit mailing list