mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-300069 vcs: remove 'Create changelist on failed commit' option
GitOrigin-RevId: 770e7e3404c57d57741400313b388a9b66819f83
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b5d3a7884e
commit
8d81cdcef7
@@ -43,8 +43,6 @@ public final class VcsConfiguration implements PersistentStateComponent<VcsConfi
|
||||
public boolean CHECK_NEW_TODO = true;
|
||||
public TodoPanelSettings myTodoPanelSettings = new TodoPanelSettings();
|
||||
public volatile boolean CHECK_LOCALLY_CHANGED_CONFLICTS_IN_BACKGROUND = false;
|
||||
@OptionTag(tag = "confirmMoveToFailedCommit", nameAttribute = "")
|
||||
public VcsShowConfirmationOption.Value MOVE_TO_FAILED_COMMIT_CHANGELIST = VcsShowConfirmationOption.Value.DO_NOTHING_SILENTLY;
|
||||
@OptionTag(tag = "confirmRemoveEmptyChangelist", nameAttribute = "")
|
||||
public VcsShowConfirmationOption.Value REMOVE_EMPTY_INACTIVE_CHANGELISTS = VcsShowConfirmationOption.Value.SHOW_CONFIRMATION;
|
||||
public int CHANGED_ON_SERVER_INTERVAL = 60;
|
||||
|
||||
@@ -265,9 +265,7 @@ commit.dialog.no.changes.detected.title=Nothing to Commit
|
||||
commit.dialog.title=Commit Changes
|
||||
commit.dialog.default.commit.operation.name=Comm&it
|
||||
commit.dialog.include.action.name=&Include into commit
|
||||
commit.dialog.failed.commit.template=Failed commit: {0}
|
||||
commit.dialog.refresh.files=Synchronizing files\u2026
|
||||
commit.dialog.rejected.commit.template=Rejected commit: {0}
|
||||
commit.dialog.changelist.label=Changelis&t:
|
||||
commit.dialog.partial.commit.warning.title=Partial Commit Is Not Supported
|
||||
commit.dialog.partial.commit.warning.body=Partial commit is not supported for ''{0}''.\nAll changes in the selected files will be committed.
|
||||
@@ -630,9 +628,6 @@ open.repository.version.text=Open Repository Version
|
||||
open.repository.version.description=Open editor with selected revision of the file
|
||||
edit.source.action.text=Edit Source
|
||||
local.history.update.from.vcs=Update from VCS
|
||||
create.changelist.on.failed.commit=Create changelist on failed commit:
|
||||
commit.failed.confirm.prompt=Would you like to move the files that failed to commit to a separate changelist?
|
||||
commit.failed.confirm.title=Commit Failed
|
||||
unshelve.changes.dialog.title=Unshelve Changes
|
||||
unshelve.changes.progress.title=Unshelving Changes\u2026
|
||||
shelved.version.name=Shelved Version
|
||||
|
||||
-10
@@ -8,11 +8,7 @@ import com.intellij.openapi.util.Disposer
|
||||
import com.intellij.openapi.vcs.VcsApplicationSettings
|
||||
import com.intellij.openapi.vcs.VcsBundle
|
||||
import com.intellij.openapi.vcs.VcsConfiguration
|
||||
import com.intellij.openapi.vcs.VcsShowConfirmationOption
|
||||
import com.intellij.openapi.vcs.changes.conflicts.ChangelistConflictConfigurable
|
||||
import com.intellij.ui.EnumComboBoxModel
|
||||
import com.intellij.ui.SimpleListCellRenderer
|
||||
import com.intellij.ui.dsl.builder.bindItem
|
||||
import com.intellij.ui.dsl.builder.bindSelected
|
||||
import com.intellij.ui.dsl.builder.panel
|
||||
import com.intellij.ui.dsl.gridLayout.HorizontalAlign
|
||||
@@ -42,12 +38,6 @@ class CommitDialogConfigurable(private val project: Project)
|
||||
.bindSelected(settings::CLEAR_INITIAL_COMMIT_MESSAGE)
|
||||
}
|
||||
|
||||
row(VcsBundle.message("create.changelist.on.failed.commit")) {
|
||||
comboBox(EnumComboBoxModel(VcsShowConfirmationOption.Value::class.java),
|
||||
SimpleListCellRenderer.create("", VcsShowConfirmationOption::getConfirmationOptionText))
|
||||
.bindItem(settings::MOVE_TO_FAILED_COMMIT_CHANGELIST)
|
||||
}.enabledIf(changelistsEnabled)
|
||||
|
||||
group(VcsBundle.message("settings.commit.message.inspections")) {
|
||||
row {
|
||||
val panel = CommitMessageInspectionsPanel(project)
|
||||
|
||||
@@ -23,7 +23,6 @@ class VcsOptionsUsagesCollector : ProjectUsagesCollector() {
|
||||
val conf = VcsConfiguration.getInstance(project)
|
||||
val confDefault = VcsConfiguration()
|
||||
|
||||
addConfirmationIfDiffers(set, conf, confDefault, { it.MOVE_TO_FAILED_COMMIT_CHANGELIST }, OFFER_MOVE_FAILED_COMMITTED)
|
||||
addConfirmationIfDiffers(set, conf, confDefault, { it.REMOVE_EMPTY_INACTIVE_CHANGELISTS }, OFFER_REMOVE_EMPTY_CHANGELIST)
|
||||
|
||||
addBoolIfDiffers(set, conf, confDefault, { it.MAKE_NEW_CHANGELIST_ACTIVE }, CHANGELIST_MAKE_NEW_ACTIVE)
|
||||
@@ -90,7 +89,6 @@ class VcsOptionsUsagesCollector : ProjectUsagesCollector() {
|
||||
companion object {
|
||||
private val GROUP = EventLogGroup("vcs.settings", 4)
|
||||
|
||||
private val OFFER_MOVE_FAILED_COMMITTED = GROUP.registerEvent("offer.move.failed.committed", EventFields.Enum("value", ConfirmationOption::class.java))
|
||||
private val OFFER_REMOVE_EMPTY_CHANGELIST = GROUP.registerEvent("offer.remove.empty.changelist", EventFields.Enum("value", ConfirmationOption::class.java))
|
||||
|
||||
private val CHANGELIST_MAKE_NEW_ACTIVE = GROUP.registerVarargEvent("changelist.make.new.active", EventFields.Enabled)
|
||||
|
||||
@@ -5,7 +5,6 @@ import com.intellij.openapi.diagnostic.logger
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.util.text.StringUtil
|
||||
import com.intellij.openapi.vcs.AbstractVcs
|
||||
import com.intellij.openapi.vcs.VcsBundle.message
|
||||
import com.intellij.openapi.vcs.changes.ChangeListManager
|
||||
import com.intellij.openapi.vcs.changes.CommitExecutor
|
||||
import com.intellij.openapi.vcs.changes.CommitResultHandler
|
||||
@@ -13,7 +12,6 @@ import com.intellij.openapi.vcs.changes.LocalChangeList
|
||||
import com.intellij.openapi.vcs.changes.ui.CommitChangeListDialog.DIALOG_TITLE
|
||||
import com.intellij.openapi.vcs.checkin.CheckinChangeListSpecificComponent
|
||||
import com.intellij.util.ui.UIUtil.removeMnemonic
|
||||
import com.intellij.vcs.commit.SingleChangeListCommitter.Companion.moveToFailedList
|
||||
import org.jetbrains.annotations.Nls
|
||||
|
||||
private val LOG = logger<SingleChangeListCommitWorkflow>()
|
||||
@@ -56,13 +54,6 @@ open class SingleChangeListCommitWorkflow(
|
||||
|
||||
internal lateinit var commitState: ChangeListCommitState
|
||||
|
||||
override fun processExecuteChecksResult(sessionInfo: CommitSessionInfo, result: CommitChecksResult) {
|
||||
if (result.shouldCloseWindow) {
|
||||
moveToFailedList(project, commitState, message("commit.dialog.rejected.commit.template", commitState.changeList.name))
|
||||
}
|
||||
super.processExecuteChecksResult(sessionInfo, result)
|
||||
}
|
||||
|
||||
override fun performCommit(sessionInfo: CommitSessionInfo) {
|
||||
if (sessionInfo.isVcsCommit) {
|
||||
DefaultNameChangeListCleaner(project, commitState).use { doCommit(commitState) }
|
||||
|
||||
@@ -1,16 +1,8 @@
|
||||
// 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.
|
||||
package com.intellij.vcs.commit
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager.getApplication
|
||||
import com.intellij.openapi.application.ModalityState
|
||||
import com.intellij.openapi.project.Project
|
||||
import com.intellij.openapi.ui.Messages.getQuestionIcon
|
||||
import com.intellij.openapi.vcs.VcsBundle.message
|
||||
import com.intellij.openapi.vcs.VcsConfiguration
|
||||
import com.intellij.openapi.vcs.VcsShowConfirmationOption
|
||||
import com.intellij.openapi.vcs.changes.*
|
||||
import com.intellij.util.concurrency.annotations.RequiresEdt
|
||||
import com.intellij.util.ui.ConfirmationDialog.requestForConfirmation
|
||||
import org.jetbrains.annotations.Nls
|
||||
|
||||
class ChangeListCommitState(val changeList: LocalChangeList, val changes: List<Change>, val commitMessage: String) {
|
||||
@@ -34,13 +26,6 @@ open class SingleChangeListCommitter(
|
||||
|
||||
private val changeList get() = commitState.changeList
|
||||
|
||||
override fun onFailure() {
|
||||
getApplication().invokeLater(Runnable {
|
||||
val failedCommitState = ChangeListCommitState(changeList, failedToCommitChanges, commitMessage)
|
||||
moveToFailedList(project, failedCommitState, message("commit.dialog.failed.commit.template", changeList.name))
|
||||
}, ModalityState.defaultModalityState(), project.disposed)
|
||||
}
|
||||
|
||||
override fun afterRefreshChanges() {
|
||||
if (isSuccess) {
|
||||
updateChangeListAfterRefresh()
|
||||
@@ -60,41 +45,4 @@ open class SingleChangeListCommitter(
|
||||
changeListManager.scheduleAutomaticEmptyChangeListDeletion(localList)
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@JvmStatic
|
||||
@RequiresEdt
|
||||
fun moveToFailedList(project: Project, commitState: ChangeListCommitState, newChangeListName: String) {
|
||||
// No need to move since we'll get exactly the same changelist.
|
||||
val failedChanges = commitState.changes
|
||||
if (failedChanges.containsAll(commitState.changeList.changes)) return
|
||||
|
||||
val configuration = VcsConfiguration.getInstance(project)
|
||||
if (configuration.MOVE_TO_FAILED_COMMIT_CHANGELIST != VcsShowConfirmationOption.Value.DO_ACTION_SILENTLY) {
|
||||
val option = object : VcsShowConfirmationOption {
|
||||
override fun getValue(): VcsShowConfirmationOption.Value = configuration.MOVE_TO_FAILED_COMMIT_CHANGELIST
|
||||
|
||||
override fun setValue(value: VcsShowConfirmationOption.Value) {
|
||||
configuration.MOVE_TO_FAILED_COMMIT_CHANGELIST = value
|
||||
}
|
||||
|
||||
override fun isPersistent(): Boolean = true
|
||||
}
|
||||
val result = requestForConfirmation(option, project, message("commit.failed.confirm.prompt"),
|
||||
message("commit.failed.confirm.title"), getQuestionIcon())
|
||||
if (!result) return
|
||||
}
|
||||
|
||||
val changeListManager = ChangeListManager.getInstance(project)
|
||||
var index = 1
|
||||
var failedListName = newChangeListName
|
||||
while (changeListManager.findChangeList(failedListName) != null) {
|
||||
index++
|
||||
failedListName = "$newChangeListName ($index)"
|
||||
}
|
||||
|
||||
val failedList = changeListManager.addChangeList(failedListName, commitState.commitMessage)
|
||||
changeListManager.moveChangesTo(failedList, *failedChanges.toTypedArray())
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user