Skip to content

Commit

Permalink
Port away from deprecated GitCompareBranchesDialog
Browse files Browse the repository at this point in the history
  • Loading branch information
uwolfer committed Jun 13, 2021
1 parent 4b2fa40 commit f89f94f
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@
import com.google.common.base.Optional;
import com.google.gerrit.extensions.common.ChangeInfo;
import com.google.inject.Inject;
import com.intellij.dvcs.ui.CompareBranchesDialog;
import com.intellij.dvcs.util.CommitCompareInfo;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.actionSystem.PlatformDataKeys;
Expand All @@ -30,8 +32,7 @@
import com.urswolfer.intellij.plugin.gerrit.util.NotificationService;
import git4idea.GitLocalBranch;
import git4idea.repo.GitRepository;
import git4idea.ui.branch.GitCompareBranchesDialog;
import git4idea.util.GitCommitCompareInfo;
import git4idea.ui.branch.GitCompareBranchesHelper;

import java.util.Collections;
import java.util.concurrent.Callable;
Expand Down Expand Up @@ -89,12 +90,12 @@ private void diffChange(final Project project, ChangeInfo changeInfo) {
}
assert currentBranchName != null : "Current branch is neither a named branch nor a revision";

final GitCommitCompareInfo compareInfo = gerritGitUtil.loadCommitsToCompare(
CommitCompareInfo compareInfo = gerritGitUtil.loadCommitsToCompare(
Collections.singletonList(gitRepository), branchName, project);
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
new GitCompareBranchesDialog(project, branchName, currentBranchName, compareInfo, gitRepository).show();
new CompareBranchesDialog(new GitCompareBranchesHelper(project), branchName, currentBranchName, compareInfo, gitRepository, false).show();
}
});
}
Expand Down

0 comments on commit f89f94f

Please sign in to comment.