[Bps-public-commit] r11726 - in Prophet/trunk: . lib/Prophet/Replica lib/Prophet/Server t
jesse at bestpractical.com
jesse at bestpractical.com
Mon Apr 14 19:54:23 EDT 2008
Author: jesse
Date: Mon Apr 14 19:54:23 2008
New Revision: 11726
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/Replica.pm
Prophet/trunk/lib/Prophet/Replica/HTTP.pm
Prophet/trunk/lib/Prophet/Replica/SVN.pm
Prophet/trunk/lib/Prophet/Server/REST.pm
Prophet/trunk/t/real-conflicting-merge.t
Prophet/trunk/t/resty-server.t
Prophet/trunk/t/validate.t
Log:
r29700 at 101: jesse | 2008-04-14 17:39:13 -0400
renamed ressource to something more understandable
Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica.pm Mon Apr 14 19:54:23 2008
@@ -7,7 +7,7 @@
use UNIVERSAL::require;
-__PACKAGE__->mk_accessors(qw(state_handle ressource is_resdb db_uuid url));
+__PACKAGE__->mk_accessors(qw(state_handle resolution_db_handle is_resdb db_uuid url));
use constant state_db_uuid => 'state';
use Module::Pluggable search_path => 'Prophet::Replica', sub_name => 'core_replica_types', require => 1, except => qr/Prophet::Replica::(.*)::/;
@@ -121,11 +121,11 @@
);
my $source = $args{'from'};
- return unless $self->ressource;
- return unless $source->ressource;
+ return unless $self->resolution_db_handle;
+ return unless $source->resolution_db_handle;
- $self->ressource->import_changesets(
- from => $source->ressource,
+ $self->resolution_db_handle->import_changesets(
+ from => $source->resolution_db_handle,
resolver => sub { die "nono not yet" }
);
@@ -197,7 +197,7 @@
# integrate the conflict resolution change
$self->record_resolutions( $conflict->resolution_changeset );
- # $self->ressource ? $self->ressource->prophet_handle : $self->prophet_handle );
+ # $self->resolution_db_handle ? $self->resolution_db_handle->prophet_handle : $self->prophet_handle );
$args{'reporting_callback'}->( changeset => $changeset, conflict => $conflict )
if ( $args{'reporting_callback'} );
@@ -567,7 +567,9 @@
$self->_unimplemented("record_resolutions (since there is no writable handle)") unless ($self->can_write_changesets);
- my $res_handle = $self->ressource ? $self->ressource: $self;
+ # If we have a resolution db handle, record the resolutions there.
+ # Otherwise, record them locally
+ my $res_handle = $self->resolution_db_handle || $self;
return unless $changeset->changes;
Modified: Prophet/trunk/lib/Prophet/Replica/HTTP.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/HTTP.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica/HTTP.pm Mon Apr 14 19:54:23 2008
@@ -30,7 +30,7 @@
unless ( $self->is_resdb ) {
- # $self->ressource( __PACKAGE__->new( { url => $self->{url}.'/resolutions', is_resdb => 1 } ) );
+ # $self->resolution_db_handle( __PACKAGE__->new( { url => $self->{url}.'/resolutions', is_resdb => 1 } ) );
}
}
Modified: Prophet/trunk/lib/Prophet/Replica/SVN.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica/SVN.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica/SVN.pm Mon Apr 14 19:54:23 2008
@@ -56,7 +56,7 @@
my $res_url = "svn:" . $self->url;
$res_url =~ s/(\_res|)$/_res/;
- $self->ressource( __PACKAGE__->new( { url => $res_url, is_resdb => 1 } ) );
+ $self->resolution_db_handle( __PACKAGE__->new( { url => $res_url, is_resdb => 1 } ) );
}
sub state_handle { return shift } #XXX TODO better way to handle this?
Modified: Prophet/trunk/lib/Prophet/Server/REST.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Server/REST.pm (original)
+++ Prophet/trunk/lib/Prophet/Server/REST.pm Mon Apr 14 19:54:23 2008
@@ -13,8 +13,7 @@
}
sub handle_request {
- my $self = shift;
- my ($cgi) = validate_pos( @_, { isa => 'CGI' } );
+ my ($self, $cgi) = validate_pos( @_, { isa => 'Prophet::Server::REST'} , { isa => 'CGI' } );
my $http_status;
if ( my $sub = $self->can( 'handle_request_' . lc( $cgi->request_method ) ) ) {
$http_status = $sub->( $self, $cgi );
Modified: Prophet/trunk/t/real-conflicting-merge.t
==============================================================================
--- Prophet/trunk/t/real-conflicting-merge.t (original)
+++ Prophet/trunk/t/real-conflicting-merge.t Mon Apr 14 19:54:23 2008
@@ -105,7 +105,7 @@
$target->import_changesets(
from => $source,
- resdb => $target->ressource
+ resdb => $target->resolution_db_handle
);
lives_and {
Modified: Prophet/trunk/t/resty-server.t
==============================================================================
--- Prophet/trunk/t/resty-server.t (original)
+++ Prophet/trunk/t/resty-server.t Mon Apr 14 19:54:23 2008
@@ -11,9 +11,11 @@
use Prophet::Test tests => 25;
use Test::WWW::Mechanize;
use JSON;
+
my $ua = Test::WWW::Mechanize->new();
my $cli = Prophet::CLI->new();
my $s = Prophet::TestServer->new();
+
$s->prophet_handle( $cli->app_handle->handle );
my $url_root = $s->started_ok("start up my web server");
Modified: Prophet/trunk/t/validate.t
==============================================================================
--- Prophet/trunk/t/validate.t (original)
+++ Prophet/trunk/t/validate.t Mon Apr 14 19:54:23 2008
@@ -1,5 +1,6 @@
use warnings;
use strict;
+
use Test::More 'no_plan';
use File::Temp qw'tempdir';
use lib 't/lib';
More information about the Bps-public-commit
mailing list