[Bps-public-commit] r15562 - in sd/trunk: . lib/App/SD/Replica/rt
sartak at bestpractical.com
sartak at bestpractical.com
Wed Aug 27 15:10:36 EDT 2008
Author: sartak
Date: Wed Aug 27 15:10:34 2008
New Revision: 15562
Modified:
sd/trunk/ (props changed)
sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm
sd/trunk/t/sd-rt.t
Log:
r70601 at onn: sartak | 2008-08-27 15:10:21 -0400
some reindentation for clarity
Modified: sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm
==============================================================================
--- sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm (original)
+++ sd/trunk/lib/App/SD/Replica/rt/PullEncoder.pm Wed Aug 27 15:10:34 2008
@@ -24,7 +24,7 @@
my $tickets = {};
my @transactions;
- my @tickets = $self->find_matching_tickets( $args{'query'} );
+ my @tickets = $self->find_matching_tickets( $args{'query'} );
$self->sync_source->log("No tickets found.") if @tickets == 0;
@@ -33,30 +33,31 @@
$counter++;
$self->sync_source->log("Fetching ticket $id - $counter of ".scalar @tickets);
$tickets->{$id}->{ticket} = $self->_translate_final_ticket_state(
- $self->sync_source->rt->show( type => 'ticket', id => $id ) );
- push @transactions,
- @{
+ $self->sync_source->rt->show( type => 'ticket', id => $id )
+ );
+ push @transactions, @{
$self->find_matching_transactions(
ticket => $id,
starting_transaction => $first_rev
)
- };
+ };
+ }
+
+ my $txn_counter = 0;
+ my @changesets;
+ for my $txn ( sort { $b->{'id'} <=> $a->{'id'} } @transactions ) {
+ $txn_counter++;
+ $self->sync_source->log("Transcoding transaction @{[$txn->{'id'}]} - $txn_counter of ". scalar @transactions);
+ my $changeset = $self->transcode_one_txn( $txn, $tickets->{ $txn->{Ticket} }->{ticket} );
+ next unless $changeset->has_changes;
+ unshift @changesets, $changeset;
}
- my $txn_counter = 0;
- my @changesets;
- for my $txn ( sort { $b->{'id'} <=> $a->{'id'} } @transactions ) {
- $txn_counter++;
- $self->sync_source->log("Transcoding transaction @{[$txn->{'id'}]} - $txn_counter of ". scalar @transactions);
- my $changeset = $self->transcode_one_txn( $txn, $tickets->{ $txn->{Ticket} }->{ticket} );
- next unless $changeset->has_changes;
- unshift @changesets, $changeset;
- }
my $cs_counter = 0;
- for ( @changesets ) {
- $self->sync_source->log("Applying changeset ".++$cs_counter . " of ".scalar @changesets);
- $args{callback}->($_)
- }
+ for ( @changesets ) {
+ $self->sync_source->log("Applying changeset ".++$cs_counter . " of ".scalar @changesets);
+ $args{callback}->($_)
+ }
}
Modified: sd/trunk/t/sd-rt.t
==============================================================================
--- sd/trunk/t/sd-rt.t (original)
+++ sd/trunk/t/sd-rt.t Wed Aug 27 15:10:34 2008
@@ -257,8 +257,8 @@
my @attachments;
while (my $att = &$iterator) {
if ( $att->file_name ) {
- push @attachments, $att ;
- }
+ push @attachments, $att ;
+ }
}
return @attachments
}
More information about the Bps-public-commit
mailing list