60
60
import org .opengrok .indexer .logger .LoggerFactory ;
61
61
import org .opengrok .indexer .util .ForbiddenSymlinkException ;
62
62
import org .opengrok .indexer .util .IOUtils ;
63
+ import org .opengrok .indexer .util .Statistics ;
63
64
import org .opengrok .indexer .util .TandemPath ;
64
65
65
66
/**
@@ -90,7 +91,7 @@ public boolean isHistoryIndexDone() {
90
91
}
91
92
92
93
/**
93
- * Generate history for single file.
94
+ * Generate history cache for single file or directory .
94
95
* @param filename name of the file
95
96
* @param historyEntries list of HistoryEntry objects forming the (incremental) history of the file
96
97
* @param repository repository object in which the file belongs
@@ -102,6 +103,8 @@ private void doFileHistory(String filename, List<HistoryEntry> historyEntries,
102
103
Repository repository , File srcFile , File root , boolean renamed )
103
104
throws HistoryException {
104
105
106
+ Statistics statRepoHist = new Statistics ();
107
+
105
108
File file = new File (root , filename );
106
109
// Only store directory history for the top-level directory.
107
110
if (file .isDirectory () && !filename .equals (repository .getDirectoryName ())) {
@@ -138,6 +141,10 @@ private void doFileHistory(String filename, List<HistoryEntry> historyEntries,
138
141
}
139
142
140
143
storeFile (hist , file , repository , !renamed );
144
+
145
+ statRepoHist .report (LOGGER , Level .FINER ,
146
+ String .format ("Done storing history cache for '%s'" , filename ),
147
+ "filehistorycache.history" );
141
148
}
142
149
143
150
private boolean isRenamedFile (String filename , Repository repository , History history )
0 commit comments