void (@NotNull AnActionEvent e) { VcsFileRevision[] revisions = e.getRequiredData(VcsDataKeys.VCS_FILE_REVISIONS); FilePath filePath = e.getRequiredData(VcsDataKeys.FILE_PATH); VcsHistoryProvider provider = e.getRequiredData(VcsDataKeys.HISTORY_PROVIDER); DiffFromHistoryHandler customDiffHandler = provider.getHistoryDiffHandler(); DiffFromHistoryHandler diffHandler = customDiffHandler == null ? new StandardDiffFromHistoryHandler() : customDiffHandler; if (revisions.length == 2) { diffHandler.showDiffForTwo(e.getRequiredData(CommonDataKeys.PROJECT), filePath, revisions[1], revisions[0]); } else if (revisions.length == 1) { VcsFileRevision previousRevision = e.getRequiredData(FileHistoryPanelImpl.PREVIOUS_REVISION_FOR_DIFF); if (revisions[0] != null) { diffHandler.showDiffForOne(e, e.getRequiredData(CommonDataKeys.PROJECT), filePath, previousRevision, revisions[0]); } } }