[vcs] [i18n] Fix VCS tests after proofread

GitOrigin-RevId: 8040715d2e5e0a777c937e6a805affcefd890976
This commit is contained in:
Dmitriy Smirnov
2020-11-30 22:17:57 +00:00
committed by intellij-monorepo-bot
parent de08c2a947
commit 196449c652
4 changed files with 19 additions and 17 deletions
@@ -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. <a href='resolve'>Resolve them.<a/>
There are unresolved conflicts in the working tree. <a>Resolve them.<a/>
""")
}
@@ -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""")
}
@@ -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")
}
@@ -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`() {
@@ -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. <a href='resolve'>Resolve them.<a/>""")
There are unresolved conflicts in the working tree. <a href='resolve'>Resolve them.<a/>""")
}
fun `test revert with conflicts resolve in chain`() {