Search in sources :

Example 1 with DiffMixin

use of com.intellij.openapi.vcs.diff.DiffMixin in project intellij-community by JetBrains.

the class VcsContentAnnotationImpl method fileRecentlyChanged.

@Nullable
@Override
public VcsRevisionNumber fileRecentlyChanged(VirtualFile vf) {
    final ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
    final AbstractVcs vcs = vcsManager.getVcsFor(vf);
    if (vcs == null)
        return null;
    if (vcs.getDiffProvider() instanceof DiffMixin) {
        final VcsRevisionDescription description = ((DiffMixin) vcs.getDiffProvider()).getCurrentRevisionDescription(vf);
        final Date date = description.getRevisionDate();
        return isRecent(date) ? description.getRevisionNumber() : null;
    }
    return null;
}
Also used : ProjectLevelVcsManager(com.intellij.openapi.vcs.ProjectLevelVcsManager) DiffMixin(com.intellij.openapi.vcs.diff.DiffMixin) AbstractVcs(com.intellij.openapi.vcs.AbstractVcs) VcsRevisionDescription(com.intellij.openapi.vcs.history.VcsRevisionDescription) Date(java.util.Date) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

AbstractVcs (com.intellij.openapi.vcs.AbstractVcs)1 ProjectLevelVcsManager (com.intellij.openapi.vcs.ProjectLevelVcsManager)1 DiffMixin (com.intellij.openapi.vcs.diff.DiffMixin)1 VcsRevisionDescription (com.intellij.openapi.vcs.history.VcsRevisionDescription)1 Date (java.util.Date)1 Nullable (org.jetbrains.annotations.Nullable)1