Skip to content

Commit ba48abe

Browse files
committed
Increase repository scanning speed
1 parent 3ec7ec4 commit ba48abe

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ This project adheres to [Semantic Versioning](http://semver.org/).
2020
- The `config` command groups configuration settings by a command.
2121
- The `changelog` command will show actually used app version instead of `Unreleased` word, when used version isn't mentioned in a changelog.
2222
- The executed SVN command idle timeout changed from 20 minutes to 3 minutes.
23-
- The `commit` command remove empty lines of merged commits, when building grouped merge commit message.
23+
- The `commit` command remove empty lines of merged commits, when building grouped merge commit message.
24+
- Increased repository scanning speed from 200 to 500 revisions per run.
2425

2526
### Fixed
2627
- The non-merged revision table was shown after a successful auto-commit, when merge conflict was resolved.

src/SVNBuddy/Repository/RevisionLog/RevisionLog.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,12 @@ private function _queryRevisionData($from_revision, $to_revision, $overwrite = f
267267
*/
268268
private function _useRepositoryCollectorPlugins($from_revision, $to_revision, $overwrite = false)
269269
{
270+
$batch_size = 500; // Revision count to query in one go.
271+
270272
// The "io" isn't set during autocomplete.
271273
if ( isset($this->_io) ) {
272274
// Create progress bar for repository plugins, where data amount is known upfront.
273-
$progress_bar = $this->_io->createProgressBar(ceil(($to_revision - $from_revision) / 200) + 1);
275+
$progress_bar = $this->_io->createProgressBar(ceil(($to_revision - $from_revision) / $batch_size - 1) + 1);
274276
$progress_bar->setMessage(
275277
$overwrite ? '* Reparsing revisions:' : ' * Reading missing revisions:'
276278
);
@@ -291,7 +293,7 @@ private function _useRepositoryCollectorPlugins($from_revision, $to_revision, $o
291293
$log_command_arguments = $this->_getLogCommandArguments($plugins);
292294

293295
while ( $range_start <= $to_revision ) {
294-
$range_end = min($range_start + 199, $to_revision);
296+
$range_end = min($range_start + $batch_size, $to_revision);
295297

296298
$command_arguments = str_replace(
297299
array('{revision_range}', '{repository_url}'),

0 commit comments

Comments
 (0)