[Bps-public-commit] r14920 - in Prophet/trunk: .

spang at bestpractical.com spang at bestpractical.com
Fri Aug 8 11:04:07 EDT 2008


Author: spang
Date: Fri Aug  8 11:03:26 2008
New Revision: 14920

Modified:
   Prophet/trunk/   (props changed)
   Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm
   Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm

Log:
 r47815 at loki:  spang | 2008-08-07 15:23:23 +0100
 pod for some subs in pull command
 r47816 at loki:  spang | 2008-08-07 16:31:20 +0100
 better error messages if using --all with no cached replicas
 r47817 at loki:  spang | 2008-08-07 16:44:01 +0100
 don't pull twice if --from arg is in cached replicas
 r47818 at loki:  spang | 2008-08-07 17:07:50 +0100
 add pod for _do_merge in merge command
 r47925 at loki:  spang | 2008-08-08 16:02:20 +0100
 fix some changes that got lost on the last merge


Modified: Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Merge.pm	Fri Aug  8 11:03:26 2008
@@ -32,6 +32,21 @@
     print "Merge complete.\n";
 }
 
+=head2 _do_merge $source $target
+
+Merges changesets from the source replica into the target replica.
+
+Fails fatally if the source and target are the same, or the target is
+not writable.
+
+Conflicts are resolved by either the resolver specified in the
+C<PROPHET_RESOLVER> environmental variable, the C<prefer> argument
+(can be set to C<to> or C<from>, in which case Prophet will
+always prefer changesets from one replica or the other), or by
+using a default resolver.
+
+=cut
+
 sub _do_merge {
     my ( $self, $source, $target ) = @_;
 

Modified: Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm	(original)
+++ Prophet/trunk/lib/Prophet/CLI/Command/Pull.pm	Fri Aug  8 11:03:26 2008
@@ -9,9 +9,9 @@
     $self->set_arg( db_uuid => $self->app_handle->handle->db_uuid ) 
         unless ($self->arg('db_uuid'));
 
-    push @from, $self->arg('from') if $self->arg('from');
-
     my %previous_sources = $self->_read_cached_upstream_replicas;
+    push @from, $self->arg('from')
+        if ($self->arg('from') && !$previous_sources{$self->arg('from')});
     push @from, keys %previous_sources if $self->has_arg('all');
 
     my @bonjour_replicas = $self->find_bonjour_replicas;
@@ -38,6 +38,14 @@
     }
 };
 
+=head2 find_bonjour_replicas
+
+Probes the local network for bonjour replicas if the local arg is specified.
+
+Returns a list of found replica URIs.
+
+=cut
+
 sub find_bonjour_replicas {
     my $self = shift;
     my @bonjour_replicas;
@@ -64,11 +72,26 @@
     return @bonjour_replicas;
 }
 
+=head2 _read_cached_upstream_replicas
+
+Returns a hash containing url => 1 pairs, where the URLs are the replicas that
+have been previously pulled from.
+
+=cut
+
 sub _read_cached_upstream_replicas {
     my $self = shift;
     return map { $_ => 1 } $self->cli->app_handle->resdb_handle->_read_cached_upstream_replicas;
 }
 
+=head2 _write_cached_upstream_replicas %replicas
+
+Writes the replica URLs given in C<keys %replicas> to the current Prophet
+repository's upstream replica cache (these replicas will be pulled from when a
+user specifies --all).
+
+=cut
+
 sub _write_cached_upstream_replicas {
     my $self  = shift;
     my %repos = @_;



More information about the Bps-public-commit mailing list