use of git4idea.util.GitCommitCompareInfo in project intellij-community by JetBrains.
the class GitBranchWorker method loadCommitsToCompare.
private GitCommitCompareInfo loadCommitsToCompare(List<GitRepository> repositories, String branchName) {
GitCommitCompareInfo compareInfo = new GitCommitCompareInfo();
for (GitRepository repository : repositories) {
compareInfo.put(repository, loadCommitsToCompare(repository, branchName));
compareInfo.put(repository, loadTotalDiff(repository, branchName));
}
return compareInfo;
}
use of git4idea.util.GitCommitCompareInfo in project intellij-community by JetBrains.
the class GithubCreatePullRequestWorker method doLoadDiffInfo.
@NotNull
private DiffInfo doLoadDiffInfo(@NotNull final BranchInfo branch) throws VcsException {
// TODO: make cancelable and abort old speculative requests (when git4idea will allow to do so)
String currentBranch = myCurrentBranch;
String targetBranch = branch.getForkInfo().getRemoteName() + "/" + branch.getRemoteName();
List<GitCommit> commits1 = GitHistoryUtils.history(myProject, myGitRepository.getRoot(), ".." + targetBranch);
List<GitCommit> commits2 = GitHistoryUtils.history(myProject, myGitRepository.getRoot(), targetBranch + "..");
Collection<Change> diff = GitChangeUtils.getDiff(myProject, myGitRepository.getRoot(), targetBranch, myCurrentBranch, null);
GitCommitCompareInfo info = new GitCommitCompareInfo(GitCommitCompareInfo.InfoType.BRANCH_TO_HEAD);
info.put(myGitRepository, diff);
info.put(myGitRepository, Couple.of(commits1, commits2));
return new DiffInfo(info, currentBranch, targetBranch);
}
use of git4idea.util.GitCommitCompareInfo in project intellij-community by JetBrains.
the class GitBranchWorker method compare.
public void compare(@NotNull final String branchName, @NotNull final List<GitRepository> repositories, @NotNull final GitRepository selectedRepository) {
final GitCommitCompareInfo myCompareInfo = loadCommitsToCompare(repositories, branchName);
if (myCompareInfo == null) {
LOG.error("The task to get compare info didn't finish. Repositories: \n" + repositories + "\nbranch name: " + branchName);
return;
}
ApplicationManager.getApplication().invokeLater(new Runnable() {
@Override
public void run() {
displayCompareDialog(branchName, GitBranchUtil.getCurrentBranchOrRev(repositories), myCompareInfo, selectedRepository);
}
});
}
Aggregations