[Bps-public-commit] r14180 - in Prophet/trunk: . t
sartak at bestpractical.com
sartak at bestpractical.com
Wed Jul 16 18:55:56 EDT 2008
Author: sartak
Date: Wed Jul 16 18:55:55 2008
New Revision: 14180
Modified:
Prophet/trunk/ (props changed)
Prophet/trunk/lib/Prophet/Replica.pm
Prophet/trunk/t/simple-push.t
Log:
r64452 at onn: sartak | 2008-07-16 18:36:50 -0400
Add support for force for new_changesets_from
Modified: Prophet/trunk/lib/Prophet/Replica.pm
==============================================================================
--- Prophet/trunk/lib/Prophet/Replica.pm (original)
+++ Prophet/trunk/lib/Prophet/Replica.pm Wed Jul 16 18:55:55 2008
@@ -450,10 +450,16 @@
sub new_changesets_for {
my $self = shift;
- my ($other) = validate_pos( @_, { isa => 'Prophet::Replica' } );
+
+ # the first argument is always the replica
+ unshift @_, 'replica';
+ my %args = validate(@_, {
+ replica => { isa => 'Prophet::Replica' },
+ force => 0,
+ });
my @result;
- $self->traverse_new_changesets( for => $other, callback => sub { push @result, $_[0] } );
+ $self->traverse_new_changesets( for => $args{replica}, callback => sub { push @result, $_[0] }, force => $args{force} );
return \@result;
}
Modified: Prophet/trunk/t/simple-push.t
==============================================================================
--- Prophet/trunk/t/simple-push.t (original)
+++ Prophet/trunk/t/simple-push.t Wed Jul 16 18:55:55 2008
@@ -45,7 +45,7 @@
};
-my $changesets = [ map { $_->as_hash } grep { $_->has_changes } @{$bob->new_changesets_for($alice)}];
+my $changesets = [ map { $_->as_hash } grep { $_->has_changes } @{$bob->new_changesets_for($alice, force => 1)}];
my $seq = delete $changesets->[0]->{'sequence_no'};
my $orig_seq = delete $changesets->[0]->{'original_sequence_no'};
is($seq, $orig_seq);
More information about the Bps-public-commit
mailing list