Search in sources :

Example 1 with GitMergeDialog

use of git4idea.merge.GitMergeDialog in project intellij-community by JetBrains.

the class GitMerge method displayDialog.

@Nullable
@Override
protected DialogState displayDialog(@NotNull Project project, @NotNull List<VirtualFile> gitRoots, @NotNull VirtualFile defaultRoot) {
    GitVcs vcs = GitVcs.getInstance(project);
    if (vcs == null) {
        return null;
    }
    final GitMergeDialog dialog = new GitMergeDialog(project, gitRoots, defaultRoot);
    try {
        dialog.updateBranches();
    } catch (VcsException e) {
        if (vcs.getExecutableValidator().checkExecutableAndShowMessageIfNeeded(null)) {
            vcs.showErrors(Collections.singletonList(e), GitBundle.getString("merge.retrieving.branches"));
        }
        return null;
    }
    if (!dialog.showAndGet()) {
        return null;
    }
    return new DialogState(dialog.getSelectedRoot(), GitBundle.message("merging.title", dialog.getSelectedRoot().getPath()), new Computable<GitLineHandler>() {

        @Override
        public GitLineHandler compute() {
            return dialog.handler();
        }
    });
}
Also used : GitVcs(git4idea.GitVcs) GitLineHandler(git4idea.commands.GitLineHandler) GitMergeDialog(git4idea.merge.GitMergeDialog) VcsException(com.intellij.openapi.vcs.VcsException) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

VcsException (com.intellij.openapi.vcs.VcsException)1 GitVcs (git4idea.GitVcs)1 GitLineHandler (git4idea.commands.GitLineHandler)1 GitMergeDialog (git4idea.merge.GitMergeDialog)1 Nullable (org.jetbrains.annotations.Nullable)1