mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[lvcs] record a different name for the amend
GitOrigin-RevId: 6f61814cb3562bc5e5a9ff568e4094fe07223470
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b49df6b111
commit
ab8f5f5b3a
@@ -1255,6 +1255,7 @@ gutter.name.version.control.ignored.directories=Version control ignored director
|
||||
|
||||
activity.name.commit=Commit changes
|
||||
activity.name.commit.message=Commit changes: {0}
|
||||
activity.name.amend.message=Amend commit: {0}
|
||||
activity.name.update=Update from VCS
|
||||
activity.name.get=Get from VCS
|
||||
activity.name.get.from=Get from {0}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
// Copyright 2000-2020 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.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.vcs.commit
|
||||
|
||||
import com.intellij.history.LocalHistory
|
||||
import com.intellij.openapi.application.runReadAction
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.Key
|
||||
import com.intellij.openapi.util.NlsContexts
|
||||
import com.intellij.openapi.vcs.AbstractVcs
|
||||
import com.intellij.openapi.vcs.VcsBundle
|
||||
import com.intellij.openapi.vcs.VcsRoot
|
||||
@@ -13,6 +14,7 @@ import com.intellij.openapi.vcs.changes.ChangesUtil.processChangesByVcs
|
||||
import com.intellij.openapi.vcs.changes.committed.CommittedChangesCache
|
||||
import com.intellij.openapi.vcs.update.RefreshVFsSynchronously
|
||||
import com.intellij.vcs.VcsActivity
|
||||
import org.jetbrains.annotations.ApiStatus
|
||||
import org.jetbrains.annotations.Nls
|
||||
|
||||
private val COMMIT_WITHOUT_CHANGES_ROOTS_KEY = Key.create<Collection<VcsRoot>>("Vcs.Commit.CommitWithoutChangesRoots")
|
||||
@@ -87,7 +89,7 @@ open class LocalChangesCommitter(
|
||||
|
||||
VcsDirtyScopeManager.getInstance(project).filePathsDirty(pathsToRefresh, null)
|
||||
|
||||
LocalHistory.getInstance().putEventLabel(project, VcsBundle.message("activity.name.commit.message", commitMessage), VcsActivity.Commit)
|
||||
LocalHistory.getInstance().putEventLabel(project, getLocalHistoryEventName(commitContext, commitMessage), VcsActivity.Commit)
|
||||
}
|
||||
finally {
|
||||
ChangeListManager.getInstance(project).invokeAfterUpdate(true) { fireAfterRefresh() }
|
||||
@@ -126,4 +128,10 @@ private class ChangeListDataCleaner(val committer: LocalChangesCommitter) : Comm
|
||||
changeListManager.editChangeListData(listName, null)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ApiStatus.Internal
|
||||
fun getLocalHistoryEventName(commitContext: CommitContext, commitMessage: String): @NlsContexts.Label String {
|
||||
if (commitContext.isAmendCommitMode) return VcsBundle.message("activity.name.amend.message", commitMessage)
|
||||
return VcsBundle.message("activity.name.commit.message", commitMessage)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package git4idea.index
|
||||
|
||||
import com.intellij.history.LocalHistory
|
||||
@@ -13,6 +13,7 @@ import com.intellij.openapi.vfs.VirtualFile
|
||||
import com.intellij.vcs.VcsActivity
|
||||
import com.intellij.vcs.commit.AbstractCommitter
|
||||
import com.intellij.vcs.commit.commitWithoutChangesRoots
|
||||
import com.intellij.vcs.commit.getLocalHistoryEventName
|
||||
import com.intellij.vcsUtil.VcsFileUtil
|
||||
import git4idea.GitUtil.getRepositoryForFile
|
||||
import git4idea.checkin.*
|
||||
@@ -65,7 +66,7 @@ internal class GitStageCommitter(
|
||||
}
|
||||
finally {
|
||||
refreshChanges()
|
||||
LocalHistory.getInstance().putEventLabel(project, VcsBundle.message("activity.name.commit.message", commitMessage), VcsActivity.Commit)
|
||||
LocalHistory.getInstance().putEventLabel(project, getLocalHistoryEventName(commitContext, commitMessage), VcsActivity.Commit)
|
||||
stagingAreaActionInvoked()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user