[git] Improve notification if exception happens during collecting of unmerged files

This commit is contained in:
Kirill Likhodedov
2013-01-25 15:45:24 +04:00
parent af6dd71870
commit d6e1af112f
2 changed files with 7 additions and 7 deletions
@@ -208,7 +208,9 @@ public class GitConflictResolver {
}
}
} catch (VcsException e) {
notifyException(mergeDialogInvokedFromNotification, e);
if (((GitVcs)myPlatformFacade.getVcs(myProject)).getExecutableValidator().checkExecutableAndNotifyIfNeeded()) {
notifyException(e);
}
}
return false;
@@ -224,12 +226,10 @@ public class GitConflictResolver {
});
}
private void notifyException(boolean mergeDialogInvokedFromNotification, VcsException e) {
private void notifyException(VcsException e) {
LOG.info("mergeFiles ", e);
final String description = mergeDialogInvokedFromNotification
? "Be sure to resolve all conflicts before update. <br/>"
: "Be sure to resolve all conflicts first. ";
GitVcs.IMPORTANT_ERROR_NOTIFICATION.createNotification("Not all conflicts resolved",
final String description = "Couldn't check the working tree for unmerged files because of an error.";
GitVcs.IMPORTANT_ERROR_NOTIFICATION.createNotification(myParams.myErrorNotificationTitle,
description + myParams.myErrorNotificationAdditionalDescription + "<br/>" +
e.getLocalizedMessage(),
NotificationType.ERROR,
@@ -370,7 +370,7 @@ public class GitUpdateProcess {
private boolean areUnmergedFiles() {
LOG.info("areUnmergedFiles: checking if there are unmerged files...");
GitConflictResolver.Params params = new GitConflictResolver.Params();
params.setErrorNotificationTitle("Can't update");
params.setErrorNotificationTitle("Update was not started");
params.setMergeDescription("Unmerged files detected. These conflicts must be resolved before update.");
return !new GitMergeCommittingConflictResolver(myProject, myGit, myMerger, GitUtil.getRootsFromRepositories(myRepositories),
params, false).merge();