void (@NotNull AnActionEvent e) { final VirtualFile file = requireNonNull(VcsContextUtil.selectedFile(e.getDataContext())); final Project project = requireNonNull(e.getProject()); final AbstractVcs vcs = requireNonNull(ProjectLevelVcsManager.getInstance(project).getVcsFor(file)); VcsCachingHistory.collectInBackground(vcs, VcsUtil.getFilePath(file), VcsBackgroundableActions.COMPARE_WITH, session -> { if (session == null) return; final List<VcsFileRevision> revisions = session.getRevisionList(); final HistoryAsTreeProvider treeHistoryProvider = session.getHistoryAsTreeProvider(); if (treeHistoryProvider != null) { showTreePopup(treeHistoryProvider.createTreeOn(revisions), project, selected -> showSelectedRevision(selected.getRevisionNumber(), vcs, file, project)); } else { showListPopup(revisions, project, selected -> showSelectedRevision(selected.getRevisionNumber(), vcs, file, project), true); } }); }