From 196449c652d1e86657dd6602e9db7e74eb87aab4 Mon Sep 17 00:00:00 2001 From: Dmitriy Smirnov Date: Tue, 3 Nov 2020 20:58:53 +0300 Subject: [PATCH] [vcs] [i18n] Fix VCS tests after proofread GitOrigin-RevId: 8040715d2e5e0a777c937e6a805affcefd890976 --- .../cherrypick/GitCherryPickAutoCommitTest.kt | 10 +++++----- .../cherrypick/GitCherryPickNoAutoCommitTest.kt | 7 ++++--- .../tests/git4idea/cherrypick/GitCherryPickTest.kt | 6 +++--- .../git4idea/tests/git4idea/revert/GitRevertTest.kt | 13 +++++++------ 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickAutoCommitTest.kt b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickAutoCommitTest.kt index 5c2a87e37773..c87881811ecd 100644 --- a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickAutoCommitTest.kt +++ b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickAutoCommitTest.kt @@ -1,6 +1,7 @@ // Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package git4idea.cherrypick +import git4idea.i18n.GitBundle import git4idea.test.* class GitCherryPickAutoCommitTest : GitCherryPickTest() { @@ -57,9 +58,9 @@ class GitCherryPickAutoCommitTest : GitCherryPickTest() { `assert merge dialog was shown`() changeListManager.assertChangeListExists("on_master") - assertWarningNotification("Cherry-pick performed with conflicts", """ + assertWarningNotification(GitBundle.message("apply.changes.operation.performed.with.conflicts", "Cherry-pick"), """ ${shortHash(commit)} on_master - Unresolved conflicts remain in the working tree. Resolve them. + There are unresolved conflicts in the working tree. Resolve them. """) } @@ -109,9 +110,8 @@ class GitCherryPickAutoCommitTest : GitCherryPickTest() { assertErrorNotification("Cherry-pick failed", """ ${shortHash(commit2)} appended common - Your local changes would be overwritten by cherry-pick. - Commit your changes or stash them to proceed. - However cherry-pick succeeded for the following commit: + """ + GitBundle.message("apply.changes.would.be.overwritten", "cherry-pick") + """ + """ + GitBundle.message("apply.changes.operation.successful.for.commits", "cherry-pick", 1) + """ ${shortHash(commit1)} fix #1""") } diff --git a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickNoAutoCommitTest.kt b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickNoAutoCommitTest.kt index e51cedb27761..61bc23c2f71e 100644 --- a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickNoAutoCommitTest.kt +++ b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickNoAutoCommitTest.kt @@ -2,6 +2,7 @@ package git4idea.cherrypick import com.intellij.openapi.vcs.changes.LocalChangeList +import git4idea.i18n.GitBundle import git4idea.test.* class GitCherryPickNoAutoCommitTest : GitCherryPickTest() { @@ -109,10 +110,10 @@ class GitCherryPickNoAutoCommitTest : GitCherryPickTest() { cherryPick(commit1, commit2) assertLastMessage("fix #1") - assertWarningNotification("Cherry-pick cancelled", """ + assertWarningNotification(GitBundle.message("apply.changes.operation.canceled", "Cherry-pick"), """ ${shortHash(commit2)} fix #2 - However cherry-pick succeeded for the following commit: - ${shortHash(commit1)} fix #1""".trimIndent()) + """ + GitBundle.message("apply.changes.operation.successful.for.commits", "cherry-pick", 1) + """ + ${shortHash(commit1)} fix #1""") val list = changeListManager.assertChangeListExists("fix #2") assertChanges(list, "2.txt") } diff --git a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickTest.kt b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickTest.kt index 1fcd856a15e6..a071a48eb5d1 100644 --- a/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickTest.kt +++ b/plugins/git4idea/tests/git4idea/cherrypick/GitCherryPickTest.kt @@ -16,6 +16,7 @@ package git4idea.cherrypick import com.intellij.vcs.log.impl.HashImpl +import git4idea.i18n.GitBundle import git4idea.test.* abstract class GitCherryPickTest : GitSingleRepoTest() { @@ -31,9 +32,8 @@ abstract class GitCherryPickTest : GitSingleRepoTest() { cherryPick(commit) assertErrorNotification("Cherry-pick failed", """ - ${shortHash(commit)} fix #1 - Your local changes would be overwritten by cherry-pick. - Commit your changes or stash them to proceed.""") + ${shortHash(commit)} fix #1 + """ + GitBundle.message("apply.changes.would.be.overwritten", "cherry-pick")) } protected fun `check untracked file conflicting with commit`() { diff --git a/plugins/git4idea/tests/git4idea/revert/GitRevertTest.kt b/plugins/git4idea/tests/git4idea/revert/GitRevertTest.kt index 0871724f7d06..d587706c037f 100644 --- a/plugins/git4idea/tests/git4idea/revert/GitRevertTest.kt +++ b/plugins/git4idea/tests/git4idea/revert/GitRevertTest.kt @@ -23,6 +23,7 @@ import git4idea.GitContentRevision.createRevision import git4idea.GitRevisionNumber import git4idea.history.GitHistoryUtils import git4idea.history.GitLogUtil +import git4idea.i18n.GitBundle import git4idea.test.* import java.nio.charset.Charset @@ -55,7 +56,7 @@ class GitRevertTest : GitSingleRepoTest() { assertErrorNotification("Revert failed", """ ${commit.id.toShortString()} ${commit.subject} - Your local changes would be overwritten by revert. Commit your changes or stash them to proceed.""") + """ + GitBundle.message("apply.changes.would.be.overwritten", "revert")) assertEquals("File content shouldn't change", "initial\nsecond\n", file.read()) assertEquals("No new commits should have been created", commit.id.asString(), last()) } @@ -93,9 +94,9 @@ class GitRevertTest : GitSingleRepoTest() { revertAutoCommit(commit2, commit1) assertErrorNotification("Revert failed",""" - ${commit1.id.toShortString()} ${commit1.subject} Your local changes would be overwritten by revert. - Commit your changes or stash them to proceed. - However revert succeeded for the following commit: + ${commit1.id.toShortString()} ${commit1.subject} + """ + GitBundle.message("apply.changes.would.be.overwritten", "revert") + """ + """ + GitBundle.message("apply.changes.operation.successful.for.commits", "revert", 1) + """ ${commit2.id.toShortString()} ${commit2.subject}""") assertFalse("File should have been deleted", rFile.exists()) repo.assertLatestSubjects("Revert \"${commit2.subject}\"") @@ -148,9 +149,9 @@ class GitRevertTest : GitSingleRepoTest() { revertAutoCommit(commitToRevert) - assertWarningNotification("Revert performed with conflicts", """ + assertWarningNotification(GitBundle.message("apply.changes.operation.performed.with.conflicts", "Revert"), """ ${commitToRevert.id.toShortString()} ${commitToRevert.subject} - Unresolved conflicts remain in the working tree. Resolve them.""") + There are unresolved conflicts in the working tree. Resolve them.""") } fun `test revert with conflicts resolve in chain`() {