Index: trunk/extensions/CodeReview/svnImport.php |
— | — | @@ -25,9 +25,10 @@ |
26 | 26 | |
27 | 27 | $startTime = microtime( true ); |
28 | 28 | $revCount = 0; |
| 29 | +$start = $lastStoredRev + 1; |
29 | 30 | |
30 | 31 | echo "Syncing repo {$args[0]} from r$lastStoredRev to HEAD...\n"; |
31 | | -for( $start = $lastStoredRev + 1; $start < $lastRev; $start += $chunkSize ) { |
| 32 | +while( $start <= $lastRev ) { |
32 | 33 | $log = $svn->getLog( '', $start, $start + $chunkSize - 1 ); |
33 | 34 | if( empty($log) ) { |
34 | 35 | # Repo seems to give a blank when max rev is invalid, which |
— | — | @@ -36,8 +37,9 @@ |
37 | 38 | if( $chunkSize <= 1 ) { |
38 | 39 | die(); // done! |
39 | 40 | } |
40 | | - $start = max( $lastStoredRev + 1, $start - $chunkSize ); // Go back! |
41 | | - $chunkSize = max( 1, floor($chunkSize/3) ); |
| 41 | + $chunkSize = max( 1, floor($chunkSize/4) ); |
| 42 | + } else { |
| 43 | + $start += $chunkSize; |
42 | 44 | } |
43 | 45 | foreach( $log as $data ) { |
44 | 46 | $revCount++; |