diff options
Diffstat (limited to 'platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java')
-rw-r--r-- | platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java index 2e34d7819e77..19b1420ddda9 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ui/CommitHelper.java @@ -41,6 +41,7 @@ import com.intellij.openapi.vcs.checkin.CheckinHandler; import com.intellij.openapi.vcs.ui.VcsBalloonProblemNotifier; import com.intellij.openapi.vcs.update.RefreshVFsSynchronously; import com.intellij.util.Consumer; +import com.intellij.util.Function; import com.intellij.util.NullableFunction; import com.intellij.util.WaitForProgressToShow; import com.intellij.util.concurrency.Semaphore; @@ -581,7 +582,7 @@ public class CommitHelper { } else { if (myCustomResultHandler == null) { - showErrorDialogAndMoveToAnotherList(processor, errorsSize, warningsSize); + showErrorDialogAndMoveToAnotherList(processor, errorsSize, warningsSize, errors); } else { myCustomResultHandler.onFailure(); @@ -589,19 +590,26 @@ public class CommitHelper { } } - private void showErrorDialogAndMoveToAnotherList(final GeneralCommitProcessor processor, final int errorsSize, final int warningsSize) { + private void showErrorDialogAndMoveToAnotherList(final GeneralCommitProcessor processor, final int errorsSize, final int warningsSize, + @NotNull final List<VcsException> errors) { WaitForProgressToShow.runOrInvokeLaterAboveProgress(new Runnable() { public void run() { - final String message; + String message; if (errorsSize > 0 && warningsSize > 0) { message = VcsBundle.message("message.text.commit.failed.with.errors.and.warnings"); } else if (errorsSize > 0) { - message = VcsBundle.message("message.text.commit.failed.with.errors"); + message = StringUtil.pluralize(VcsBundle.message("message.text.commit.failed.with.error"), errorsSize); } else { - message = VcsBundle.message("message.text.commit.finished.with.warnings"); + message = StringUtil.pluralize(VcsBundle.message("message.text.commit.finished.with.warning"), warningsSize); } + message += ":\n" + StringUtil.join(errors, new Function<VcsException, String>() { + @Override + public String fun(VcsException e) { + return e.getMessage(); + } + }, "\n"); //new VcsBalloonProblemNotifier(myProject, message, MessageType.ERROR).run(); Messages.showErrorDialog(message, VcsBundle.message("message.title.commit")); |