Search in sources :

Example 1 with GitHistoryProvider

use of git4idea.history.GitHistoryProvider in project intellij-community by JetBrains.

the class GitAnnotationProvider method loadFileHistory.

@Nullable
private List<VcsFileRevision> loadFileHistory(@NotNull FilePath filePath) throws VcsException {
    GitVcs vcs = GitVcs.getInstance(myProject);
    if (vcs == null)
        return null;
    GitHistoryProvider historyProvider = vcs.getVcsHistoryProvider();
    VcsAbstractHistorySession cachedSession = myCache.getFull(filePath, vcs.getKeyInstanceMethod(), historyProvider);
    if (cachedSession != null && !ContainerUtil.isEmpty(cachedSession.getRevisionList())) {
        return cachedSession.getRevisionList();
    } else {
        VcsAbstractHistorySession session = historyProvider.createSessionFor(filePath);
        if (session == null)
            return null;
        myCache.put(filePath, null, vcs.getKeyInstanceMethod(), session, historyProvider, true);
        return session.getRevisionList();
    }
}
Also used : GitVcs(git4idea.GitVcs) GitHistoryProvider(git4idea.history.GitHistoryProvider) VcsAbstractHistorySession(com.intellij.openapi.vcs.history.VcsAbstractHistorySession) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

VcsAbstractHistorySession (com.intellij.openapi.vcs.history.VcsAbstractHistorySession)1 GitVcs (git4idea.GitVcs)1 GitHistoryProvider (git4idea.history.GitHistoryProvider)1 Nullable (org.jetbrains.annotations.Nullable)1