diff --git a/platform/vcs-log/api/resources/messages/VcsLogBundle.properties b/platform/vcs-log/api/resources/messages/VcsLogBundle.properties index 45593ddd61d8..e7d54a451ecf 100644 --- a/platform/vcs-log/api/resources/messages/VcsLogBundle.properties +++ b/platform/vcs-log/api/resources/messages/VcsLogBundle.properties @@ -197,7 +197,7 @@ vcs.log.action.highlight.merge.commits=Merge Commits vcs.log.action.highlight.my.commits=My Commits # messages -vcs.log.recreated.due.to.corruption=VCS Log was recreated {0} times due to data corruption\nDelete {1} directory and restart {2} if this happens often.\n{3} +vcs.log.recreated.due.to.corruption={0} Log was recreated {1} times due to data corruption.\nDelete {2} directory and restart {3} if this happens often. vcs.log.fatal.error.message=Could not delete {0}\nDelete it manually and restart IDEA. vcs.log.is.not.available=Vcs Log is not available diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java index e575c6c1d853..c3daf1914400 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/impl/VcsProjectLog.java @@ -157,21 +157,23 @@ public class VcsProjectLog implements Disposable { @CalledInAwt private void recreateOnError(@NotNull Throwable t) { - if ((++myRecreatedLogCount) % RECREATE_LOG_TRIES == 0) { - String message = VcsLogBundle.message("vcs.log.recreated.due.to.corruption", - myRecreatedLogCount, - LOG_CACHE, - ApplicationNamesInfo.getInstance().getFullProductName(), - t.getMessage()); - LOG.error(message, t); + myRecreatedLogCount++; + String logMessage = "Recreating Vcs Log after storage corruption. Recreated count " + myRecreatedLogCount; + if (myRecreatedLogCount % RECREATE_LOG_TRIES == 0) { + LOG.error(logMessage, t); VcsLogManager manager = getLogManager(); if (manager != null && manager.isLogVisible()) { - VcsBalloonProblemNotifier.showOverChangesView(myProject, message, MessageType.ERROR); + String balloonMessage = VcsLogBundle.message("vcs.log.recreated.due.to.corruption", + VcsLogUtil.getVcsDisplayName(myProject, manager), + myRecreatedLogCount, + LOG_CACHE, + ApplicationNamesInfo.getInstance().getFullProductName()); + VcsBalloonProblemNotifier.showOverChangesView(myProject, balloonMessage, MessageType.ERROR); } } else { - LOG.debug("Recreating VCS Log after storage corruption", t); + LOG.debug(logMessage, t); } disposeLog(true); diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/OpenAnotherLogTabAction.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/OpenAnotherLogTabAction.java index d1239710b25a..d9fbfff0dd89 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/OpenAnotherLogTabAction.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/ui/actions/OpenAnotherLogTabAction.java @@ -60,7 +60,7 @@ public class OpenAnotherLogTabAction extends DumbAwareAction { // only for main log (it is a question, how and where we want to open tabs for external logs) e.getPresentation().setEnabledAndVisible(projectLog.getLogManager() == logManager); - String vcsName = VcsLogUtil.getVcsDisplayName(project, logManager.getDataManager().getLogProviders().values()); + String vcsName = VcsLogUtil.getVcsDisplayName(project, logManager); e.getPresentation().setText(getText(vcsName)); e.getPresentation().setDescription(getDescription(vcsName)); } diff --git a/platform/vcs-log/impl/src/com/intellij/vcs/log/util/VcsLogUtil.java b/platform/vcs-log/impl/src/com/intellij/vcs/log/util/VcsLogUtil.java index 1572c0a5384d..725fb1f26772 100644 --- a/platform/vcs-log/impl/src/com/intellij/vcs/log/util/VcsLogUtil.java +++ b/platform/vcs-log/impl/src/com/intellij/vcs/log/util/VcsLogUtil.java @@ -21,6 +21,7 @@ import com.intellij.vcs.log.data.RefsModel; import com.intellij.vcs.log.data.VcsLogData; import com.intellij.vcs.log.impl.MainVcsLogUiProperties; import com.intellij.vcs.log.impl.VcsChangesLazilyParsedDetails; +import com.intellij.vcs.log.impl.VcsLogManager; import com.intellij.vcs.log.impl.VcsLogUiProperties; import com.intellij.vcs.log.ui.VcsLogInternalDataKeys; import com.intellij.vcsUtil.VcsUtil; @@ -350,4 +351,9 @@ public class VcsLogUtil { if (vcs.size() != 1) return VcsLogBundle.message("vcs"); return Objects.requireNonNull(getFirstItem(vcs)).getDisplayName(); } + + @NotNull + public static String getVcsDisplayName(@NotNull Project project, @NotNull VcsLogManager logManager) { + return getVcsDisplayName(project, logManager.getDataManager().getLogProviders().values()); + } }