mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Git] if not all conflicts resolved, notify. Relates to IDEA-51187
This commit is contained in:
@@ -17,13 +17,13 @@ package git4idea.history.browser;
|
||||
|
||||
import com.intellij.lifecycle.PeriodicalTasksCloser;
|
||||
import com.intellij.openapi.application.ModalityState;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.MessageType;
|
||||
import com.intellij.openapi.vcs.AbstractVcsHelper;
|
||||
import com.intellij.openapi.vcs.FilePath;
|
||||
import com.intellij.openapi.vcs.VcsException;
|
||||
import com.intellij.openapi.vcs.changes.*;
|
||||
import com.intellij.openapi.vcs.checkin.CheckinEnvironment;
|
||||
import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier;
|
||||
import com.intellij.openapi.vfs.LocalFileSystem;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.util.Consumer;
|
||||
@@ -31,6 +31,8 @@ import git4idea.GitVcs;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import static com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier.showOverChangesView;
|
||||
|
||||
public class CherryPicker {
|
||||
private final GitVcs myVcs;
|
||||
private final List<GitCommit> myCommits;
|
||||
@@ -41,6 +43,7 @@ public class CherryPicker {
|
||||
private final List<FilePath> myDirtyFiles;
|
||||
private final List<String> myMessagesInOrder;
|
||||
private final Map<String, Collection<FilePath>> myFilesToMove;
|
||||
private boolean myConflictsExist;
|
||||
|
||||
public CherryPicker(GitVcs vcs, final List<GitCommit> commits, LowLevelAccess access) {
|
||||
myVcs = vcs;
|
||||
@@ -90,15 +93,19 @@ public class CherryPicker {
|
||||
}
|
||||
|
||||
private void showResults() {
|
||||
if (myExceptions.isEmpty()) {
|
||||
VcsBalloonProblemNotifier
|
||||
.showOverChangesView(myVcs.getProject(), "Successful cherry-pick into working tree, please commit changes", MessageType.INFO);
|
||||
final Project project = myVcs.getProject();
|
||||
if (myExceptions.isEmpty() && !myConflictsExist) {
|
||||
showOverChangesView(project, "Successful cherry-pick into working tree, please commit changes", MessageType.INFO);
|
||||
} else {
|
||||
VcsBalloonProblemNotifier.showOverChangesView(myVcs.getProject(), "Errors in cherry-pick", MessageType.ERROR);
|
||||
if (myExceptions.isEmpty()) {
|
||||
showOverChangesView(project, "Unresolved conflicts while cherry-picking. Resolve conflicts, then commit changes", MessageType.WARNING);
|
||||
} else {
|
||||
showOverChangesView(project, "Errors in cherry-pick", MessageType.ERROR);
|
||||
}
|
||||
}
|
||||
if ((! myExceptions.isEmpty()) || (! myWarnings.isEmpty())) {
|
||||
myExceptions.addAll(myWarnings);
|
||||
AbstractVcsHelper.getInstance(myVcs.getProject()).showErrors(myExceptions, "Cherry-pick problems");
|
||||
AbstractVcsHelper.getInstance(project).showErrors(myExceptions, "Cherry-pick problems");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -130,7 +137,9 @@ public class CherryPicker {
|
||||
private void cherryPickStep(CheckinEnvironment ce, int i) {
|
||||
final GitCommit commit = myCommits.get(i);
|
||||
try {
|
||||
myAccess.cherryPick(commit);
|
||||
if (!myAccess.cherryPick(commit)) {
|
||||
myConflictsExist = true;
|
||||
}
|
||||
}
|
||||
catch (VcsException e) {
|
||||
myExceptions.add(e);
|
||||
|
||||
Reference in New Issue
Block a user