IDEA-244040 [vcs] Specify allowed notification ids via holder
authorDaniil Tsaryov <daniil.tsaryov@jetbrains.com>
Wed, 18 Nov 2020 11:53:21 +0000 (14:53 +0300)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 27 Nov 2020 13:56:30 +0000 (13:56 +0000)
GitOrigin-RevId: 38bfa471c771b39b76dc3248fe451cdf16036c7e

17 files changed:
platform/dvcs-impl/src/com/intellij/dvcs/actions/DvcsCompareWithBranchAction.java
platform/dvcs-impl/src/com/intellij/dvcs/cherrypick/VcsCherryPickManager.java
platform/vcs-impl/resources/META-INF/VcsExtensions.xml
platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/PatchApplier.java
platform/vcs-impl/src/com/intellij/openapi/diff/impl/patch/formove/TriggerAdditionOrDeletion.java
platform/vcs-impl/src/com/intellij/openapi/vcs/VcsNotificationIdsHolder.kt
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/DefaultPreservingExecutorImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/CreatePatchFromChangesAction.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/ignore/IgnoredFileGeneratorImpl.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/ApplyPatchAction.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/patch/CreatePatchCommitExecutor.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelveChangesManager.java
platform/vcs-impl/src/com/intellij/openapi/vcs/changes/shelf/ShelvedChangesViewManager.java
platform/vcs-impl/src/com/intellij/openapi/vcs/history/VcsDiffUtil.java
platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsIntegrationEnabler.java
platform/vcs-impl/src/com/intellij/openapi/vcs/roots/VcsRootProblemNotifier.java
platform/vcs-impl/src/com/intellij/vcs/commit/ShowNotificationCommitResultHandler.kt

index d10894d966badc346d5d725ca21a5aa3066da316..33b588d4d489d1a6719077a1c6b790ba87e8fa33 100644 (file)
@@ -28,6 +28,7 @@ import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.COULD_NOT_COMPARE_WITH_BRANCH;
 import static com.intellij.util.ObjectUtils.chooseNotNull;
 import static com.intellij.util.containers.UtilKt.getIfSingle;
 
@@ -97,7 +98,7 @@ public abstract class DvcsCompareWithBranchAction<T extends Repository> extends
         }
         catch (VcsException e) {
           VcsNotifier.getInstance(project).notifyImportantWarning(
-            "vcs.could.not.compare.with.branch",
+            COULD_NOT_COMPARE_WITH_BRANCH,
             DvcsBundle.message("notification.title.couldn.t.compare.with.branch"),
             DvcsBundle.message("notification.message.couldn.t.compare.with.branch",
                                file.isDirectory() ? 1 : 0, file.getPresentableUrl(), compare, e.getMessage()));
index d7f034f9556c6dd501bf8e3ee73e736ecf933c5b..1634249218a07fb46ad52d57b74bef674c467132 100644 (file)
@@ -25,6 +25,8 @@ import org.jetbrains.annotations.Nullable;
 
 import java.util.*;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.CHERRY_PICK_ERROR;
+
 public final class VcsCherryPickManager {
   private static final Logger LOG = Logger.getInstance(VcsCherryPickManager.class);
   @NotNull private final Project myProject;
@@ -96,7 +98,7 @@ public final class VcsCherryPickManager {
     }
 
     public void showError(@Nls @NotNull String message) {
-      VcsNotifier.getInstance(myProject).notifyWeakError("vcs.cherry.pick.error", message);
+      VcsNotifier.getInstance(myProject).notifyWeakError(CHERRY_PICK_ERROR, message);
       LOG.warn(message);
     }
 
index e8cf9607a56767637dd3e4625f38a72ec821944b..8f0b243ec591e8715437c609040ceab6bf357584 100644 (file)
     <projectService serviceImplementation="com.intellij.openapi.vcs.impl.VcsDirectoryMappingStorage" preload="true"/>
     <notificationGroup id="Vcs Messages" displayType="TOOL_WINDOW" toolWindowId="Version Control"/>
     <notificationGroup id="Common Version Control Messages" displayType="TOOL_WINDOW" toolWindowId="Version Control"/>
-    <notificationGroup id="Vcs Important Messages" displayType="STICKY_BALLOON" notificationIds="ignored.to.exclude.synchronization.notification;
-    externally.added.files.notification;project.configuration.files.added.notification;manage.ignore.files.notification"/>
+    <notificationGroup id="Vcs Important Messages" displayType="STICKY_BALLOON"/>
     <notificationGroup id="Vcs Notifications" displayType="BALLOON"/>
     <notificationGroup id="Vcs Silent Notifications" displayType="NONE"/>
     <projectService serviceInterface="com.intellij.execution.configurations.RunConfigurationVcsSupport"
index 699bbca0d3af5f95ddfea1c3689b0e0d5c88484b..0c152f20ec47b5ce5c9fd695edc5bcf38ef91ab2 100644 (file)
@@ -42,6 +42,7 @@ import java.util.*;
 import java.util.concurrent.atomic.AtomicBoolean;
 
 import static com.intellij.openapi.progress.ProgressManager.progress;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.*;
 import static com.intellij.util.ObjectUtils.chooseNotNull;
 
 /**
@@ -247,13 +248,13 @@ public final class PatchApplier {
       try {
         labelToRevert.revert(project, project.getBaseDir());
         VcsNotifier.getInstance(project)
-          .notifyImportantWarning("vcs.patch.apply.aborted",
+          .notifyImportantWarning(PATCH_APPLY_ABORTED,
                                   VcsBundle.message("patch.apply.aborted.title"),
                                   VcsBundle.message("patch.apply.aborted.message"));
       }
       catch (LocalHistoryException e) {
         VcsNotifier.getInstance(project)
-          .notifyImportantWarning("vcs.patch.apply.rollback.failed",
+          .notifyImportantWarning(PATCH_APPLY_ROLLBACK_FAILED,
                                   VcsBundle.message("patch.apply.rollback.failed.title"),
                                   VcsBundle.message("patch.apply.rollback.failed.message"));
       }
@@ -415,13 +416,13 @@ public final class PatchApplier {
   private static void showApplyStatus(@NotNull Project project, final ApplyPatchStatus status) {
     VcsNotifier vcsNotifier = VcsNotifier.getInstance(project);
     if (status == ApplyPatchStatus.ALREADY_APPLIED) {
-      vcsNotifier.notifyMinorInfo("vcs.patch.apply.already.applied", VcsBundle.message("patch.apply.notification.title"), VcsBundle.message("patch.apply.already.applied"));
+      vcsNotifier.notifyMinorInfo(PATCH_ALREADY_APPLIED, VcsBundle.message("patch.apply.notification.title"), VcsBundle.message("patch.apply.already.applied"));
     }
     else if (status == ApplyPatchStatus.PARTIAL) {
-      vcsNotifier.notifyMinorInfo("vcs.patch.apply.partially.applied", VcsBundle.message("patch.apply.notification.title"), VcsBundle.message("patch.apply.partially.applied"));
+      vcsNotifier.notifyMinorInfo(PATCH_PARTIALLY_APPLIED, VcsBundle.message("patch.apply.notification.title"), VcsBundle.message("patch.apply.partially.applied"));
     }
     else if (status == ApplyPatchStatus.SUCCESS) {
-      vcsNotifier.notifySuccess("vcs.patch.apply.success.applied", "",
+      vcsNotifier.notifySuccess(PATCH_APPLY_SUCCESS, "",
                                 VcsBundle.message("patch.apply.success.applied.text"));
     }
   }
index af66f81d64997c3e857c5c8dd548aa0ff750d4ce..5418e406cabaa7a587f2c21661dbadf01aa5acc3 100644 (file)
@@ -14,6 +14,7 @@ import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.PATCH_APPLY_NEW_FILES_ERROR;
 import static com.intellij.util.Functions.identity;
 import static com.intellij.vcsUtil.VcsUtil.groupByRoots;
 import static java.util.Objects.requireNonNull;
@@ -114,7 +115,7 @@ public class TriggerAdditionOrDeletion {
   private void notifyAndLogFiles(@NotNull List<FilePath> incorrectFilePath) {
     String message = VcsBundle.message("patch.apply.incorrectly.processed.warning", incorrectFilePath.size(), incorrectFilePath);
     LOG.warn(message);
-    VcsNotifier.getInstance(myProject).notifyImportantWarning("vcs.patch.apply.new.files.error",
+    VcsNotifier.getInstance(myProject).notifyImportantWarning(PATCH_APPLY_NEW_FILES_ERROR,
                                                               VcsBundle.message("patch.apply.new.files.warning"),
                                                               message);
   }
index c33b9bfae32714b71330d874dc4a614950c5762d..1e0959ce264c3de9b77211de9c37fd30c2512862 100644 (file)
@@ -5,17 +5,65 @@ import com.intellij.notification.impl.NotificationIdsHolder
 
 class VcsNotificationIdsHolder : NotificationIdsHolder {
   override fun getNotificationIds(): List<String> {
-    return listOf(IGNORED_TO_EXCLUDE_SYNCHRONIZATION,
-                  EXTERNALLY_ADDED_FILES,
-                  PROJECT_CONFIGURATION_FILES_ADDED,
-                  MANAGE_IGNORE_FILES)
+    return listOf(
+      EXTERNALLY_ADDED_FILES,
+      PROJECT_CONFIGURATION_FILES_ADDED,
+      MANAGE_IGNORE_FILES,
+      CHERRY_PICK_ERROR,
+      COMMIT_CANCELED,
+      COMMIT_FAILED,
+      COMMIT_FINISHED,
+      COMMIT_FINISHED_WITH_WARNINGS,
+      COMPARE_FAILED,
+      COULD_NOT_COMPARE_WITH_BRANCH,
+      PATCH_APPLY_ABORTED,
+      PATCH_ALREADY_APPLIED,
+      PATCH_APPLY_CANNOT_FIND_PATCH_FILE,
+      PATCH_APPLY_NEW_FILES_ERROR,
+      PATCH_APPLY_NOT_PATCH_FILE,
+      PATCH_PARTIALLY_APPLIED,
+      PATCH_APPLY_ROLLBACK_FAILED,
+      PATCH_APPLY_SUCCESS,
+      PATCH_COPIED_TO_CLIPBOARD,
+      PATCH_CREATION_FAILED,
+      ROOT_ADDED,
+      ROOTS_INVALID,
+      ROOTS_REGISTERED,
+      SHELVE_DELETION_UNDO,
+      SHELVE_FAILED,
+      SHELVE_SUCCESSFUL,
+      UNCOMMITTED_CHANGES_SAVING_ERROR
+    )
   }
 
   companion object {
-    const val IGNORED_TO_EXCLUDE_SYNCHRONIZATION = "ignored.to.exclude.synchronization.notification"
     const val EXTERNALLY_ADDED_FILES = "externally.added.files.notification"
     const val PROJECT_CONFIGURATION_FILES_ADDED = "project.configuration.files.added.notification"
     const val MANAGE_IGNORE_FILES = "manage.ignore.files.notification"
+    const val CHERRY_PICK_ERROR = "vcs.cherry.pick.error"
+    const val COMMIT_CANCELED = "vcs.commit.canceled"
+    const val COMMIT_FAILED = "vcs.commit.failed"
+    const val COMMIT_FINISHED = "vcs.commit.finished"
+    const val COMMIT_FINISHED_WITH_WARNINGS = "vcs.commit.finished.with.warnings"
+    const val COMPARE_FAILED = "vcs.compare.failed"
+    const val COULD_NOT_COMPARE_WITH_BRANCH = "vcs.could.not.compare.with.branch"
+    const val PATCH_APPLY_ABORTED = "vcs.patch.apply.aborted"
+    const val PATCH_ALREADY_APPLIED = "vcs.patch.already.applied"
+    const val PATCH_APPLY_CANNOT_FIND_PATCH_FILE = "vcs.patch.apply.cannot.find.patch.file"
+    const val PATCH_APPLY_NEW_FILES_ERROR = "vcs.patch.apply.new.files.error"
+    const val PATCH_APPLY_NOT_PATCH_FILE = "vcs.patch.apply.not.patch.type.file"
+    const val PATCH_PARTIALLY_APPLIED = "vcs.patch.partially.applied"
+    const val PATCH_APPLY_ROLLBACK_FAILED = "vcs.patch.apply.rollback.failed"
+    const val PATCH_APPLY_SUCCESS = "vcs.patch.apply.success.applied"
+    const val PATCH_COPIED_TO_CLIPBOARD = "vcs.patch.copied.to.clipboard"
+    const val PATCH_CREATION_FAILED = "vcs.patch.creation.failed"
+    const val ROOT_ADDED = "vcs.root.added"
+    const val ROOTS_INVALID = "vcs.roots.invalid"
+    const val ROOTS_REGISTERED = "vcs.roots.registered"
+    const val SHELVE_DELETION_UNDO = "vcs.shelve.deletion.undo"
+    const val SHELVE_FAILED = "vcs.shelve.failed"
+    const val SHELVE_SUCCESSFUL = "vcs.shelve.successful"
+    const val UNCOMMITTED_CHANGES_SAVING_ERROR = "vcs.uncommitted.changes.saving.error"
   }
 }
 
index d27bc54a15f5e953b359b3e9d526e9d4cdf007c2..d91b4d383ffb73d2fe3ecabad23923b9782c791e 100644 (file)
@@ -15,6 +15,7 @@ import org.jetbrains.annotations.NotNull;
 import java.util.Collection;
 
 import static com.intellij.openapi.util.text.StringUtil.join;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.UNCOMMITTED_CHANGES_SAVING_ERROR;
 
 /**
  * VCS-independent implementation for {@link VcsPreservingExecutor}
@@ -75,7 +76,7 @@ class DefaultPreservingExecutorImpl {
                                           myOperationTitle,
                                           join(e.getMessages()));
         VcsNotifier.getInstance(myProject).notifyError(
-          "vcs.uncommitted.changes.saving.error",
+          UNCOMMITTED_CHANGES_SAVING_ERROR,
           VcsBundle.message("notification.title.couldn.t.save.uncommitted.changes"),
           format);
         return false;
index 555141120c66cf0e6f7de209612f9851404a7bda..48d93df8f69a66a2330b803916c2caf682bd833d 100644 (file)
@@ -37,6 +37,8 @@ import java.util.Arrays;
 import java.util.Collection;
 import java.util.List;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.PATCH_CREATION_FAILED;
+
 public abstract class CreatePatchFromChangesAction extends ExtendableAction implements DumbAware {
   private static final Logger LOG = Logger.getInstance(CreatePatchFromChangesAction.class);
   private static final ExtensionPointName<AnActionExtensionProvider> EP_NAME_DIALOG =
@@ -163,7 +165,7 @@ public abstract class CreatePatchFromChangesAction extends ExtendableAction impl
       }
       catch (IOException | VcsException exception) {
         LOG.warn("Can't create patch", exception);
-        VcsNotifier.getInstance(project).notifyWeakError("vcs.patch.creation.failed",
+        VcsNotifier.getInstance(project).notifyWeakError(PATCH_CREATION_FAILED,
                                                          VcsBundle.message("patch.creation.failed"),
                                                          exception.getMessage());
       }
index 5bc05a1e2dac201c14705dbd78b33461f8b6501a..08abbf5e8e6b98f9bf650b9aeb550407173c4214 100644 (file)
@@ -36,6 +36,7 @@ import java.util.Collections;
 import java.util.HashSet;
 import java.util.Set;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.MANAGE_IGNORE_FILES;
 import static com.intellij.openapi.vcs.changes.ignore.IgnoreConfigurationProperty.ASKED_MANAGE_IGNORE_FILES_PROPERTY;
 import static com.intellij.openapi.vcs.changes.ignore.IgnoreConfigurationProperty.MANAGE_IGNORE_FILES_PROPERTY;
 import static java.lang.System.lineSeparator;
@@ -156,7 +157,7 @@ public class IgnoredFileGeneratorImpl implements IgnoredFileGenerator {
 
       myIgnoreFileRootNotificationShowFor = ignoreFileRoot;
       myNotification = VcsNotifier.getInstance(project).notifyMinorInfo(
-        "vcs.manage.ignored.files",
+        MANAGE_IGNORE_FILES,
         true,
         "",
         VcsBundle.message("ignored.file.manage.message",
index e799a357e03942a9f1d03359222cf0427fa971ea..2a83271e33504a18bbe3473120210d8d07f6aa96 100644 (file)
@@ -45,6 +45,8 @@ import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.PATCH_APPLY_NOT_PATCH_FILE;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.PATCH_APPLY_CANNOT_FIND_PATCH_FILE;
 import static com.intellij.openapi.vcs.changes.patch.PatchFileType.isPatchFile;
 
 public final class ApplyPatchAction extends DumbAwareAction {
@@ -106,12 +108,12 @@ public final class ApplyPatchAction extends DumbAwareAction {
     VirtualFile vFile = VfsUtil.findFileByIoFile(file, true);
     String patchPath = file.getPath();
     if (vFile == null) {
-      VcsNotifier.getInstance(project).notifyWeakError("vcs.patch.apply.cannot.find.patch.file",
+      VcsNotifier.getInstance(project).notifyWeakError(PATCH_APPLY_CANNOT_FIND_PATCH_FILE,
                                                        VcsBundle.message("patch.apply.can.t.find.patch.file.warning", patchPath));
       return false;
     }
     if (!isPatchFile(vFile)) {
-      VcsNotifier.getInstance(project).notifyWeakError("vcs.patch.apply.not.patch.type.file",
+      VcsNotifier.getInstance(project).notifyWeakError(PATCH_APPLY_NOT_PATCH_FILE,
                                                        VcsBundle.message("patch.apply.not.patch.type.file.error", patchPath));
       return false;
     }
index 961da539386804bb3d0d4ad14e452da4125ffca9..8810b41db3eec592c06dc312947123b755fa8c9d 100644 (file)
@@ -44,6 +44,8 @@ import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.PATCH_COPIED_TO_CLIPBOARD;
+
 public final class CreatePatchCommitExecutor extends LocalCommitExecutor {
   private static final Logger LOG = Logger.getInstance(CreatePatchCommitExecutor.class);
   private static final String VCS_PATCH_PATH_KEY = "vcs.patch.path"; //NON-NLS
@@ -338,7 +340,7 @@ public final class CreatePatchCommitExecutor extends LocalCommitExecutor {
                                            @NotNull CommitContext commitContext) throws VcsException, IOException {
     List<FilePatch> patches = patchBuilder.buildPatches(baseDir, changes, reversePatch, honorExcludedFromCommit);
     PatchWriter.writeAsPatchToClipboard(project, patches, baseDir, commitContext);
-    VcsNotifier.getInstance(project).notifySuccess("vcs.patch.copied.to.clipboard", "",
+    VcsNotifier.getInstance(project).notifySuccess(PATCH_COPIED_TO_CLIPBOARD, "",
                                                    VcsBundle.message("patch.copied.to.clipboard"));
   }
 
index f5281d80fbf81862e10773118f93a2c3ef57cadf..5206098708665c3adabc45b21c7e975811b00789 100644 (file)
@@ -79,6 +79,8 @@ import java.util.concurrent.locks.ReentrantReadWriteLock;
 import java.util.function.Consumer;
 
 import static com.intellij.openapi.util.text.StringUtil.notNullize;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.SHELVE_FAILED;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.SHELVE_SUCCESSFUL;
 import static com.intellij.openapi.vcs.changes.ChangeListUtil.getChangeListNameForUnshelve;
 import static com.intellij.openapi.vcs.changes.ChangeListUtil.getPredefinedChangeList;
 import static com.intellij.openapi.vcs.changes.shelf.ShelvedChangeList.createShelvedChangesFromFilePatches;
@@ -917,7 +919,7 @@ public final class ShelveChangesManager implements PersistentStateComponent<Elem
 
       @Override
       public void onSuccess() {
-        VcsNotifier.getInstance(myProject).notifySuccess("vcs.shelve.successful", "",
+        VcsNotifier.getInstance(myProject).notifySuccess(SHELVE_SUCCESSFUL, "",
                                                          VcsBundle.message("shelve.successful.message"));
         if (result.size() == 1 && isShelfContentActive()) {
           ShelvedChangesViewManager.getInstance(myProject).startEditing(result.get(0));
@@ -997,7 +999,7 @@ public final class ShelveChangesManager implements PersistentStateComponent<Elem
 
     if (!failedChangeLists.isEmpty()) {
       VcsNotifier.getInstance(myProject).notifyError(
-        "vcs.shelve.failed",
+        SHELVE_FAILED,
         VcsBundle.message("shelve.failed.title"),
         VcsBundle.message("shelve.failed.message", failedChangeLists.size(), StringUtil.join(failedChangeLists, ",")));
     }
index 0118199d4a2a0729fbb95d3a8127ead664bf14de..9692c4eb63d2649bc8c82841dccd299ef4163cff 100644 (file)
@@ -83,6 +83,7 @@ import java.util.function.Predicate;
 import java.util.stream.Collectors;
 
 import static com.intellij.icons.AllIcons.Vcs.Patch_applied;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.SHELVE_DELETION_UNDO;
 import static com.intellij.openapi.vcs.changes.shelf.DiffShelvedChangesActionProvider.createAppliedTextPatch;
 import static com.intellij.openapi.vcs.changes.ui.ChangesGroupingSupport.REPOSITORY_GROUPING;
 import static com.intellij.openapi.vcs.changes.ui.ChangesViewContentManager.*;
@@ -562,7 +563,7 @@ public class ShelvedChangesViewManager implements Disposable {
         myListDateMap.forEach((l, d) -> manager.restoreList(l, d));
         notification.expire();
         if (!cantRestoreList.isEmpty()) {
-          VcsNotifier.getInstance(myProject).notifyMinorWarning("vcs.shelve.deletion.undo",
+          VcsNotifier.getInstance(myProject).notifyMinorWarning(SHELVE_DELETION_UNDO,
                                                                 VcsBundle.message("shelve.undo.deletion"),
                                                                 VcsBundle.message("shelve.changes.restore.error", cantRestoreList.size()));
         }
index 5e211b584cf76c9277c696d63642d435681d433b..2143090d9d2c56d5c5c125d3fca780a3f4e0ef01 100644 (file)
@@ -36,6 +36,7 @@ import java.util.*;
 
 import static com.intellij.diff.util.DiffUserDataKeysEx.VCS_DIFF_LEFT_CONTENT_TITLE;
 import static com.intellij.diff.util.DiffUserDataKeysEx.VCS_DIFF_RIGHT_CONTENT_TITLE;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.COMPARE_FAILED;
 import static com.intellij.vcsUtil.VcsUtil.getShortRevisionString;
 
 public final class VcsDiffUtil {
@@ -163,7 +164,7 @@ public final class VcsDiffUtil {
           String title = VcsBundle.message("history.notification.title.compare.with.failed", getShortRevisionString(targetRevNumber));
           String message =
             VcsBundle.message("history.notification.content.couldn.t.compare.with.revision", file,getShortRevisionString(targetRevNumber));
-          VcsNotifier.getInstance(project).notifyError("vcs.compare.failed", title, message + "\n " + e.getMessage());
+          VcsNotifier.getInstance(project).notifyError(COMPARE_FAILED, title, message + "\n " + e.getMessage());
         }
       }
 
index d2997c8dd7123a13e06334838e8e418223ad02f1..a453ac0bd79bda36eaeb2f47b3568c7ffaf81353 100644 (file)
@@ -26,6 +26,7 @@ import org.jetbrains.annotations.NotNull;
 
 import java.util.*;
 
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.ROOT_ADDED;
 import static java.util.stream.Collectors.toList;
 
 public abstract class VcsIntegrationEnabler {
@@ -77,7 +78,7 @@ public abstract class VcsIntegrationEnabler {
 
   protected void notifyAddedRoots(Collection<? extends VirtualFile> roots) {
     String message = VcsBundle.message("roots.notification.content.added.vcs.name.roots", myVcs.getName(), roots.size(), joinRootsPaths(roots));
-    VcsNotifier.getInstance(myProject).notifySuccess("vcs.root.added", "", message);
+    VcsNotifier.getInstance(myProject).notifySuccess(ROOT_ADDED, "", message);
   }
 
   private void addVcsRoots(@NotNull Collection<? extends VirtualFile> roots) {
index 6b37fb45a706d81dc36504449d0863f54d42503e..b2ac5936612ee890849feb26ebcd05e4c1f181dd 100644 (file)
@@ -30,6 +30,8 @@ import java.util.*;
 
 import static com.intellij.openapi.util.io.FileUtil.toSystemDependentName;
 import static com.intellij.openapi.util.text.StringUtil.escapeXmlEntities;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.ROOTS_INVALID;
+import static com.intellij.openapi.vcs.VcsNotificationIdsHolder.ROOTS_REGISTERED;
 import static com.intellij.openapi.vcs.VcsRootError.Type.UNREGISTERED_ROOT;
 import static com.intellij.util.containers.ContainerUtil.*;
 import static com.intellij.util.ui.UIUtil.BR;
@@ -135,8 +137,8 @@ public final class VcsRootProblemNotifier {
       VcsNotifier notifier = VcsNotifier.getInstance(myProject);
 
       myNotification = invalidRoots.isEmpty()
-                       ? notifier.notifyMinorInfo("vcs.roots.registered", title, description, notificationActions)
-                       : notifier.notifyError("vcs.roots.invalid", title, description, getConfigureNotificationAction());
+                       ? notifier.notifyMinorInfo(ROOTS_REGISTERED, title, description, notificationActions)
+                       : notifier.notifyError(ROOTS_INVALID, title, description, getConfigureNotificationAction());
     }
   }
 
index ddf928ebd00e844f3ccfe2b5ebae124e41aa5fb0..7eaa3f36bfc7c223f8d3f141aa1268a090ccf054 100644 (file)
@@ -5,6 +5,10 @@ import com.intellij.openapi.util.NlsContexts
 import com.intellij.openapi.util.text.StringUtil.*
 import com.intellij.openapi.vcs.VcsBundle.message
 import com.intellij.openapi.vcs.VcsException
+import com.intellij.openapi.vcs.VcsNotificationIdsHolder.Companion.COMMIT_CANCELED
+import com.intellij.openapi.vcs.VcsNotificationIdsHolder.Companion.COMMIT_FAILED
+import com.intellij.openapi.vcs.VcsNotificationIdsHolder.Companion.COMMIT_FINISHED
+import com.intellij.openapi.vcs.VcsNotificationIdsHolder.Companion.COMMIT_FINISHED_WITH_WARNINGS
 import com.intellij.openapi.vcs.VcsNotifier
 import com.intellij.openapi.vcs.changes.CommitResultHandler
 import com.intellij.util.ui.UIUtil
@@ -28,7 +32,7 @@ class ShowNotificationCommitResultHandler(private val committer: AbstractCommitt
 
   override fun onSuccess(commitMessage: String) = reportResult()
   override fun onCancel() {
-    notifier.notifyMinorWarning("vcs.commit.canceled", "", message("vcs.commit.canceled"))
+    notifier.notifyMinorWarning(COMMIT_CANCELED, "", message("vcs.commit.canceled"))
   }
   override fun onFailure(errors: List<VcsException>) = reportResult()
 
@@ -42,13 +46,13 @@ class ShowNotificationCommitResultHandler(private val committer: AbstractCommitt
     when {
       errorsSize > 0 -> {
         val title = message("message.text.commit.failed.with.error", errorsSize)
-        notifier.notifyError("vcs.commit.failed", title, message)
+        notifier.notifyError(COMMIT_FAILED, title, message)
       }
       warningsSize > 0 -> {
         val title = message("message.text.commit.finished.with.warning", warningsSize)
-        notifier.notifyImportantWarning("vcs.commit.finished.with.warnings", title, message)
+        notifier.notifyImportantWarning(COMMIT_FINISHED_WITH_WARNINGS, title, message)
       }
-      else -> notifier.notifySuccess("vcs.commit.finished", "", message)
+      else -> notifier.notifySuccess(COMMIT_FINISHED, "", message)
     }
   }