Search in sources :

Example 1 with GitCompareBranchesDialog

use of git4idea.ui.branch.GitCompareBranchesDialog in project intellij-community by JetBrains.

the class GithubCreatePullRequestWorker method showDiffDialog.

public void showDiffDialog(@Nullable final BranchInfo branch) {
    if (branch == null) {
        GithubNotifications.showWarningDialog(myProject, "Can't Show Diff", "Target branch is not selected");
        return;
    }
    DiffInfo info;
    try {
        info = GithubUtil.computeValueInModalIO(myProject, "Collecting diff data...", indicator -> GithubUtil.runInterruptable(indicator, () -> getDiffInfo(branch)));
    } catch (IOException e) {
        GithubNotifications.showError(myProject, "Can't collect diff data", e);
        return;
    }
    if (info == null) {
        GithubNotifications.showErrorDialog(myProject, "Can't Show Diff", "Can't collect diff data");
        return;
    }
    GitCompareBranchesDialog dialog = new GitCompareBranchesDialog(myProject, info.getTo(), info.getFrom(), info.getInfo(), myGitRepository, true);
    dialog.show();
}
Also used : Change(com.intellij.openapi.vcs.changes.Change) VirtualFile(com.intellij.openapi.vfs.VirtualFile) GithubApiUtil(org.jetbrains.plugins.github.api.GithubApiUtil) Task(com.intellij.openapi.progress.Task) GitCompareBranchesDialog(git4idea.ui.branch.GitCompareBranchesDialog) GithubRepo(org.jetbrains.plugins.github.api.data.GithubRepo) Logger(com.intellij.openapi.diagnostic.Logger) VcsException(com.intellij.openapi.vcs.VcsException) GitRepository(git4idea.repo.GitRepository) GitCommit(git4idea.GitCommit) Git(git4idea.commands.Git) GithubSelectForkDialog(org.jetbrains.plugins.github.ui.GithubSelectForkDialog) CancellationException(java.util.concurrent.CancellationException) Collection(java.util.Collection) GithubFullPath(org.jetbrains.plugins.github.api.GithubFullPath) GithubPullRequest(org.jetbrains.plugins.github.api.data.GithubPullRequest) GitCommandResult(git4idea.commands.GitCommandResult) GitChangeUtils(git4idea.changes.GitChangeUtils) EmptyProgressIndicator(com.intellij.openapi.progress.EmptyProgressIndicator) VcsCommitMetadata(com.intellij.vcs.log.VcsCommitMetadata) Nullable(org.jetbrains.annotations.Nullable) GithubOperationCanceledException(org.jetbrains.plugins.github.exceptions.GithubOperationCanceledException) ProgressIndicator(com.intellij.openapi.progress.ProgressIndicator) List(java.util.List) ServiceManager(com.intellij.openapi.components.ServiceManager) ApplicationManager(com.intellij.openapi.application.ApplicationManager) NotNull(org.jetbrains.annotations.NotNull) Couple(com.intellij.openapi.util.Couple) FutureTask(java.util.concurrent.FutureTask) Callable(java.util.concurrent.Callable) ContainerUtil(com.intellij.util.containers.ContainerUtil) org.jetbrains.plugins.github.util(org.jetbrains.plugins.github.util) ArrayList(java.util.ArrayList) ProcessCanceledException(com.intellij.openapi.progress.ProcessCanceledException) GitFetcher(git4idea.update.GitFetcher) GitHistoryUtils(git4idea.history.GitHistoryUtils) Project(com.intellij.openapi.project.Project) DialogManager(git4idea.DialogManager) GitLocalBranch(git4idea.GitLocalBranch) GithubBranch(org.jetbrains.plugins.github.api.data.GithubBranch) GitRemote(git4idea.repo.GitRemote) StringUtil(com.intellij.openapi.util.text.StringUtil) Convertor(com.intellij.util.containers.Convertor) GithubRepoDetailed(org.jetbrains.plugins.github.api.data.GithubRepoDetailed) IOException(java.io.IOException) GitCommitCompareInfo(git4idea.util.GitCommitCompareInfo) ExecutionException(java.util.concurrent.ExecutionException) Pair(com.intellij.openapi.util.Pair) GitFetchResult(git4idea.update.GitFetchResult) IOException(java.io.IOException) GitCompareBranchesDialog(git4idea.ui.branch.GitCompareBranchesDialog)

Aggregations

ApplicationManager (com.intellij.openapi.application.ApplicationManager)1 ServiceManager (com.intellij.openapi.components.ServiceManager)1 Logger (com.intellij.openapi.diagnostic.Logger)1 EmptyProgressIndicator (com.intellij.openapi.progress.EmptyProgressIndicator)1 ProcessCanceledException (com.intellij.openapi.progress.ProcessCanceledException)1 ProgressIndicator (com.intellij.openapi.progress.ProgressIndicator)1 Task (com.intellij.openapi.progress.Task)1 Project (com.intellij.openapi.project.Project)1 Couple (com.intellij.openapi.util.Couple)1 Pair (com.intellij.openapi.util.Pair)1 StringUtil (com.intellij.openapi.util.text.StringUtil)1 VcsException (com.intellij.openapi.vcs.VcsException)1 Change (com.intellij.openapi.vcs.changes.Change)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1 ContainerUtil (com.intellij.util.containers.ContainerUtil)1 Convertor (com.intellij.util.containers.Convertor)1 VcsCommitMetadata (com.intellij.vcs.log.VcsCommitMetadata)1 DialogManager (git4idea.DialogManager)1 GitCommit (git4idea.GitCommit)1 GitLocalBranch (git4idea.GitLocalBranch)1