[Bps-public-commit] r8836 - rt2-to-rt3/trunk
falcone at bestpractical.com
falcone at bestpractical.com
Thu Aug 30 13:48:49 EDT 2007
Author: falcone
Date: Thu Aug 30 13:48:48 2007
New Revision: 8836
Modified:
rt2-to-rt3/trunk/ (props changed)
rt2-to-rt3/trunk/rt-2.0-to-dumpfile
Log:
r24259 at ketch: falcone | 2007-08-30 13:35:53 -0400
* provide a way to get the last tickets in a DB, if you already
used 'first'
Modified: rt2-to-rt3/trunk/rt-2.0-to-dumpfile
==============================================================================
--- rt2-to-rt3/trunk/rt-2.0-to-dumpfile (original)
+++ rt2-to-rt3/trunk/rt-2.0-to-dumpfile Thu Aug 30 13:48:48 2007
@@ -13,7 +13,7 @@
my $mode = ( shift || 'all' );
my $since = ( shift || undef );
-my $row_limit = ($mode eq 'first') ? $since : undef;
+my $row_limit = ($mode =~ /^(?:first|after)$/) ? $since : undef;
# Set to 0 to not bother exporting dead/deleted tickets.
my $export_dead = 1;
@@ -308,7 +308,11 @@
export_tickets();
}
else {
- print STDERR "Doing a partial export since $since\n";
+ if ($mode eq 'after') {
+ print STDERR "Doing a partial export of the last $row_limit rows\n";
+ } else {
+ print STDERR "Doing a partial export since $since\n";
+ }
print STDERR "Exporting Users\n";
my @users = export_users($ds);
$ds->{'User'} = \@users;
@@ -341,6 +345,13 @@
$tix->RowsPerPage($row_limit);
}
+ # limit to tickets after the given id, so you can add on to a "first" export
+ if ($mode eq 'after' && $row_limit) {
+ $tix->Limit( FIELD => 'id',
+ OPERATOR => ">",
+ VALUE => $row_limit);
+ }
+
## XXX we could Limit on 'Status' '!=' 'dead' if $export_dead == 0,
## but then we'd not be able to say /why/ we're not exporting the
## ticket...
More information about the Bps-public-commit
mailing list