@Nullable
  private static Pair<FilePath, VcsRevisionNumber> getFileAndRevision(@NotNull AnActionEvent event) {
    Change[] changes = event.getData(VcsDataKeys.SELECTED_CHANGES);
    if (changes == null || changes.length != 1) return null;
    Change change = changes[0];
    Pair<FilePath, VcsRevisionNumber> fileAndRevision = getFileAndRevision(change);
    if (fileAndRevision == null ||
        (change.getType() != Change.Type.DELETED && !fileAndRevision.second.asString().isEmpty())) return fileAndRevision;

    Project project = event.getProject();
    if (project == null ||
        !canShowNewFileHistory(project, fileAndRevision.getFirst(), fileAndRevision.getSecond().asString())) return fileAndRevision;
    VcsRevisionNumber revisionNumber = event.getData(VcsDataKeys.VCS_REVISION_NUMBER);
    if (revisionNumber == null) return fileAndRevision;

    return Pair.create(fileAndRevision.getFirst(), revisionNumber);
  }
@Nullable
  private static Pair<FilePath, VcsRevisionNumber> getFileAndRevision(@NotNull AnActionEvent event)