mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-05 01:50:56 +07:00
[git] Delete GitOngoingOperationAction
GitOrigin-RevId: e9cb8ee2e92070f7ba41523a624d849777d4bb84
This commit is contained in:
committed by
intellij-monorepo-bot
parent
37600c5ef0
commit
dc23e7c94e
@@ -174,7 +174,6 @@
|
||||
<action id="git.update.force.pushed.branch" class="git4idea.actions.branch.GitForcePushedBranchUpdateAction" internal="true"/>
|
||||
|
||||
<group id="Git.Ongoing.Rebase.Actions" popup="false">
|
||||
<!-- See GitOngoingOperationAction -->
|
||||
<reference id="Git.Rebase.Abort"/>
|
||||
<reference id="Git.Merge.Abort"/>
|
||||
<reference id="Git.CherryPick.Abort"/>
|
||||
|
||||
@@ -62,8 +62,8 @@ internal abstract class GitAbortOperationAction(
|
||||
|
||||
final override fun getMainToolbarIcon(): Icon = AllIcons.Vcs.Abort
|
||||
|
||||
override fun performInBackground(repository: GitRepository): Boolean {
|
||||
if (!confirmAbort(repository)) return false
|
||||
override fun performInBackground(repository: GitRepository) {
|
||||
if (!confirmAbort(repository)) return
|
||||
|
||||
runBackgroundableTask(GitBundle.message("abort.operation.progress.title", operationNameCapitalised), repository.project) { indicator ->
|
||||
doAbort(repository, indicator)
|
||||
@@ -71,7 +71,6 @@ internal abstract class GitAbortOperationAction(
|
||||
|
||||
GitApplyChangesNotification.expireAll<GitApplyChangesNotification.ExpireAfterAbort>(repository.project)
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
private fun confirmAbort(repository: GitRepository): Boolean {
|
||||
|
||||
@@ -38,14 +38,13 @@ public abstract class GitAbstractRebaseAction extends GitOperationActionBase {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean performInBackground(@NotNull GitRepository repositoryToOperate) {
|
||||
public void performInBackground(@NotNull GitRepository repositoryToOperate) {
|
||||
ProgressManager.getInstance().run(new Task.Backgroundable(repositoryToOperate.getProject(), getProgressTitle()) {
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
performActionForRepository(repositoryToOperate.getProject(), repositoryToOperate, indicator);
|
||||
}
|
||||
});
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,14 +0,0 @@
|
||||
// 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.actions;
|
||||
|
||||
import git4idea.repo.GitRepository;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface GitOngoingOperationAction {
|
||||
boolean isEnabled(@NotNull GitRepository repository);
|
||||
|
||||
/**
|
||||
* @return false if operation was not performed
|
||||
*/
|
||||
boolean performInBackground(@NotNull GitRepository repository);
|
||||
}
|
||||
@@ -18,7 +18,7 @@ import javax.swing.Icon
|
||||
|
||||
abstract class GitOperationActionBase (
|
||||
private val repositoryState: Repository.State
|
||||
) : DumbAwareAction(), GitOngoingOperationAction {
|
||||
) : DumbAwareAction() {
|
||||
protected abstract val operationName: @Nls String
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
@@ -50,8 +50,7 @@ abstract class GitOperationActionBase (
|
||||
}
|
||||
}
|
||||
|
||||
override fun isEnabled(repository: GitRepository): Boolean = repository.state == repositoryState
|
||||
|
||||
abstract fun performInBackground(repository: GitRepository)
|
||||
|
||||
private fun getAffectedRepositories(project: Project?): Collection<GitRepository> {
|
||||
if (project == null) return emptyList()
|
||||
|
||||
Reference in New Issue
Block a user