use of com.virtuslab.gitmachete.frontend.actions.dialogs.OverrideForkPointDialog in project git-machete-intellij-plugin by VirtusLab.
the class BaseOverrideForkPointAction method actionPerformed.
@Override
@UIEffect
public void actionPerformed(AnActionEvent anActionEvent) {
val project = getProject(anActionEvent);
val gitRepository = getSelectedGitRepository(anActionEvent).getOrNull();
val branchUnderAction = getNameOfBranchUnderAction(anActionEvent);
val branch = branchUnderAction.flatMap(pn -> getManagedBranchByName(anActionEvent, pn)).getOrNull();
if (gitRepository == null || branch == null || branch.isRoot()) {
return;
}
val nonRootBranch = branch.asNonRoot();
val selectedCommit = new OverrideForkPointDialog(project, nonRootBranch.getParent(), nonRootBranch).showAndGetSelectedCommit();
if (selectedCommit == null) {
log().debug("Commit selected to be the new fork point is null: most likely the action has been canceled from override-fork-point dialog");
return;
}
LOG.debug("Enqueueing fork point override");
new Task.Backgroundable(project, "Overriding fork point...") {
@Override
@UIThreadUnsafe
public void run(ProgressIndicator indicator) {
overrideForkPoint(anActionEvent, branch, selectedCommit);
}
}.queue();
}
Aggregations