@@ -349,6 +349,10 @@ protected String getRevisionForAnnotate(String history_revision) {
349
349
return history_revision ;
350
350
}
351
351
352
+ protected void doCreateCache (HistoryCache cache , String sinceRevision , File directory ) throws HistoryException {
353
+ finishCreateCache (cache , getHistory (directory , sinceRevision ), null );
354
+ }
355
+
352
356
/**
353
357
* Create a history log cache for all files in this repository.
354
358
* {@code getHistory()} is used to fetch the history for the entire
@@ -380,34 +384,10 @@ final void createCache(HistoryCache cache, String sinceRevision) throws HistoryE
380
384
381
385
File directory = new File (getDirectoryName ());
382
386
383
- History history ;
384
- if (!(this instanceof RepositoryWithPerPartesHistory )) {
385
- history = getHistory (directory , sinceRevision );
386
- finishCreateCache (cache , history , null );
387
- return ;
388
- }
389
-
390
- // For repositories that supports this, avoid storing complete History in memory
391
- // (which can be sizeable, at least for the initial indexing, esp. if merge changeset support is enabled),
392
- // by splitting the work into multiple chunks.
393
- RepositoryWithPerPartesHistory repo = (RepositoryWithPerPartesHistory ) this ;
394
- BoundaryChangesets boundaryChangesets = new BoundaryChangesets (repo );
395
- List <String > boundaryChangesetList = boundaryChangesets .getBoundaryChangesetIDs (sinceRevision );
396
- LOGGER .log (Level .FINE , "boundary changesets: {0}" , boundaryChangesetList );
397
- int cnt = 0 ;
398
- for (String tillRevision : boundaryChangesetList ) {
399
- Statistics stat = new Statistics ();
400
- LOGGER .log (Level .FINEST , "getting history for ({0}, {1})" , new Object []{sinceRevision , tillRevision });
401
- history = repo .getHistory (directory , sinceRevision , tillRevision );
402
- finishCreateCache (cache , history , tillRevision );
403
- sinceRevision = tillRevision ;
404
-
405
- stat .report (LOGGER , Level .FINE , String .format ("finished chunk %d/%d of history cache for repository ''%s''" ,
406
- ++cnt , boundaryChangesetList .size (), this .getDirectoryName ()));
407
- }
387
+ doCreateCache (cache , sinceRevision , directory );
408
388
}
409
389
410
- private void finishCreateCache (HistoryCache cache , History history , String tillRevision ) throws HistoryException {
390
+ void finishCreateCache (HistoryCache cache , History history , String tillRevision ) throws HistoryException {
411
391
// We need to refresh list of tags for incremental reindex.
412
392
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
413
393
if (env .isTagsEnabled () && this .hasFileBasedTags ()) {
0 commit comments