[Bps-public-commit] Prophet branch, master, updated. e4f226330dfa458f24e67fc2d66c3ac0da96effa

jesse jesse at bestpractical.com
Fri May 29 16:02:01 EDT 2009


The branch, master has been updated
       via  e4f226330dfa458f24e67fc2d66c3ac0da96effa (commit)
       via  a963b1403590f39aaf2971c6517d2a277350ad2e (commit)
      from  96e0bd8292a3c98d6fabda27cbe3290068d21366 (commit)

Summary of changes:
 lib/Prophet/CLI/Command/Merge.pm |    4 ++--
 lib/Prophet/Replica.pm           |   13 ++++++++-----
 2 files changed, 10 insertions(+), 7 deletions(-)

- Log -----------------------------------------------------------------
commit a963b1403590f39aaf2971c6517d2a277350ad2e
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri May 29 16:01:02 2009 -0400

    extract "record_last_changeset_from_replica" function for reuse in foreign replicas

diff --git a/lib/Prophet/Replica.pm b/lib/Prophet/Replica.pm
index 6cd2145..d2fca7b 100644
--- a/lib/Prophet/Replica.pm
+++ b/lib/Prophet/Replica.pm
@@ -360,9 +360,6 @@ sub last_changeset_from_source {
 }
 
 
-
-
-
 =head3 has_seen_changeset L<Prophet::ChangeSet>
 
 Returns true if we've previously integrated this changeset, even if we
@@ -905,15 +902,21 @@ sub record_integration_of_changeset {
     if ( $changeset->original_source_uuid ne $self->uuid && 
         ( $self->last_changeset_from_source( $changeset->original_source_uuid ) < $changeset->original_sequence_no ) )
     {
-        return $self->store_local_metadata( 'last-changeset-from-' . $changeset->original_source_uuid => $changeset->original_sequence_no );
+            $self->record_last_changeset_from_replica($changeset->original_source_uuid => $changeset->original_sequence_no );
     }
     if ($changeset->source_uuid) {
     if ( $self->last_changeset_from_source( $changeset->source_uuid ) < $changeset->sequence_no ) {
-        return $self->store_local_metadata( 'last-changeset-from-' . $changeset->source_uuid => $changeset->sequence_no );
+            $self->record_last_changeset_from_replica($changeset->source_uuid => $changeset->sequence_no );
     }
 }
 }
 
+sub record_last_changeset_from_replica {
+    my $self = shift;
+    my ($uuid, $sequence) = validate_pos(@_, 1,1);
+        return $self->store_local_metadata( 'last-changeset-from-' . $uuid => $sequence );
+
+}
 
 =head2 routines which need to be implemented by any Prophet backend store
 

commit e4f226330dfa458f24e67fc2d66c3ac0da96effa
Author: Jesse Vincent <jesse at bestpractical.com>
Date:   Fri May 29 16:01:32 2009 -0400

    Adde --prefer source and --prefer target as synonyms for --prefer from and --prefer to, respectively

diff --git a/lib/Prophet/CLI/Command/Merge.pm b/lib/Prophet/CLI/Command/Merge.pm
index 3bd9f58..fa5ea1b 100644
--- a/lib/Prophet/CLI/Command/Merge.pm
+++ b/lib/Prophet/CLI/Command/Merge.pm
@@ -146,8 +146,8 @@ sub merge_resolver {
     my $prefer = $self->arg('prefer') || 'none';
 
     my $resolver = $ENV{'PROPHET_RESOLVER'} ? 'Prophet::Resolver::' . $ENV{'PROPHET_RESOLVER'}
-        : $prefer eq 'to'   ? 'Prophet::Resolver::AlwaysTarget'
-        : $prefer eq 'from' ? 'Prophet::Resolver::AlwaysSource'
+        : $prefer =~ /^(?:to|target)$/   ? 'Prophet::Resolver::AlwaysTarget'
+        : $prefer =~ /^(?:from|source)$/ ? 'Prophet::Resolver::AlwaysSource'
         :                     ();
     return $resolver;
 }

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list