use of com.intellij.openapi.vcs.diff.RevisionSelector in project intellij-community by JetBrains.
the class SelectAndCompareWithSelectedRevisionAction method actionPerformed.
@Override
protected void actionPerformed(@NotNull VcsContext vcsContext) {
final VirtualFile file = vcsContext.getSelectedFiles()[0];
final Project project = vcsContext.getProject();
final AbstractVcs vcs = ProjectLevelVcsManager.getInstance(project).getVcsFor(file);
if (vcs == null) {
return;
}
RevisionSelector selector = vcs.getRevisionSelector();
final DiffProvider diffProvider = vcs.getDiffProvider();
if (selector != null) {
final VcsRevisionNumber vcsRevisionNumber = selector.selectNumber(file);
if (vcsRevisionNumber != null) {
DiffActionExecutor.showDiff(diffProvider, vcsRevisionNumber, file, project, VcsBackgroundableActions.COMPARE_WITH);
}
}
}
Aggregations