@@ -438,6 +438,14 @@ private String createFileMap(History history, HashMap<String, List<HistoryEntry>
438
438
return latestRev ;
439
439
}
440
440
441
+ private static String getRevisionString (String revision ) {
442
+ if (revision == null ) {
443
+ return "end of history" ;
444
+ } else {
445
+ return "revision " + revision ;
446
+ }
447
+ }
448
+
441
449
/**
442
450
* Store history for the whole repository in directory hierarchy resembling
443
451
* the original repository structure. History of individual files will be
@@ -475,21 +483,23 @@ public void store(History history, Repository repository, String tillRevision) t
475
483
476
484
Set <String > regularFiles = map .keySet ().stream ().
477
485
filter (e -> !history .isRenamed (e )).collect (Collectors .toSet ());
478
- createDirectoriesForFiles (regularFiles , repository , "regular files for history till " + tillRevision );
486
+ createDirectoriesForFiles (regularFiles , repository , "regular files for history till " +
487
+ getRevisionString (tillRevision ));
479
488
480
489
/*
481
490
* Now traverse the list of files from the hash map built above and for each file store its history
482
491
* (saved in the value of the hash map entry for the file) in a file.
483
492
* The renamed files will be handled separately.
484
493
*/
485
- LOGGER .log (Level .FINE , "Storing history for {0} regular files in repository ''{1}'' till history {2}" ,
486
- new Object []{regularFiles .size (), repository .getDirectoryName (), tillRevision });
494
+ LOGGER .log (Level .FINE , "Storing history for {0} regular files in repository ''{1}'' till {2}" ,
495
+ new Object []{regularFiles .size (), repository .getDirectoryName (), getRevisionString ( tillRevision ) });
487
496
final File root = env .getSourceRootFile ();
488
497
489
498
final CountDownLatch latch = new CountDownLatch (regularFiles .size ());
490
499
AtomicInteger fileHistoryCount = new AtomicInteger ();
491
500
try (Progress progress = new Progress (LOGGER ,
492
- String .format ("history cache for regular files of %s till history %s" , repository , tillRevision ),
501
+ String .format ("history cache for regular files of %s till %s" , repository ,
502
+ getRevisionString (tillRevision )),
493
503
regularFiles .size ())) {
494
504
for (String file : regularFiles ) {
495
505
env .getIndexerParallelizer ().getHistoryFileExecutor ().submit (() -> {
@@ -540,16 +550,18 @@ public void storeRenamed(Set<String> renamedFiles, Repository repository, String
540
550
541
551
renamedFiles = renamedFiles .stream ().filter (f -> new File (env .getSourceRootPath () + f ).exists ()).
542
552
collect (Collectors .toSet ());
543
- LOGGER .log (Level .FINE , "Storing history for {0} renamed files in repository ''{1}'' till history {2}" ,
544
- new Object []{renamedFiles .size (), repository .getDirectoryName (), tillRevision });
553
+ LOGGER .log (Level .FINE , "Storing history for {0} renamed files in repository ''{1}'' till {2}" ,
554
+ new Object []{renamedFiles .size (), repository .getDirectoryName (), getRevisionString ( tillRevision ) });
545
555
546
- createDirectoriesForFiles (renamedFiles , repository , "renamed files for history till " + tillRevision );
556
+ createDirectoriesForFiles (renamedFiles , repository , "renamed files for history " +
557
+ getRevisionString (tillRevision ));
547
558
548
559
final Repository repositoryF = repository ;
549
560
final CountDownLatch latch = new CountDownLatch (renamedFiles .size ());
550
561
AtomicInteger renamedFileHistoryCount = new AtomicInteger ();
551
562
try (Progress progress = new Progress (LOGGER ,
552
- String .format ("history cache for renamed files of %s till history %s" , repository , tillRevision ),
563
+ String .format ("history cache for renamed files of %s till %s" , repository ,
564
+ getRevisionString (tillRevision )),
553
565
renamedFiles .size ())) {
554
566
for (final String file : renamedFiles ) {
555
567
env .getIndexerParallelizer ().getHistoryFileExecutor ().submit (() -> {
0 commit comments