mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[hg] execute mq delete in current thread
This commit is contained in:
@@ -18,11 +18,9 @@ package org.zmlx.hg4idea.command.mq;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
import org.zmlx.hg4idea.action.HgCommandResultNotifier;
|
||||
import org.zmlx.hg4idea.execution.HgCommandExecutor;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResult;
|
||||
import org.zmlx.hg4idea.execution.HgCommandResultHandler;
|
||||
import org.zmlx.hg4idea.repo.HgRepository;
|
||||
import org.zmlx.hg4idea.util.HgErrorUtil;
|
||||
|
||||
@@ -35,19 +33,15 @@ public class HgQDeleteCommand {
|
||||
myRepository = repository;
|
||||
}
|
||||
|
||||
public void execute(@NotNull final List<String> patchNames) {
|
||||
public void executeInCurrentThread(@NotNull final List<String> patchNames) {
|
||||
final Project project = myRepository.getProject();
|
||||
new HgCommandExecutor(project)
|
||||
.execute(myRepository.getRoot(), "qdelete", patchNames, new HgCommandResultHandler() {
|
||||
@Override
|
||||
public void process(@Nullable HgCommandResult result) {
|
||||
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
|
||||
new HgCommandResultNotifier(project)
|
||||
.notifyError(result, "QDelete command failed",
|
||||
"Could not delete selected " + StringUtil.pluralize("patch", patchNames.size()));
|
||||
}
|
||||
myRepository.update();
|
||||
}
|
||||
});
|
||||
HgCommandResult result = new HgCommandExecutor(project)
|
||||
.executeInCurrentThread(myRepository.getRoot(), "qdelete", patchNames);
|
||||
if (HgErrorUtil.hasErrorsInCommandExecution(result)) {
|
||||
new HgCommandResultNotifier(project)
|
||||
.notifyError(result, "QDelete command failed",
|
||||
"Could not delete selected " + StringUtil.pluralize("patch", patchNames.size()));
|
||||
}
|
||||
myRepository.update();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -260,7 +260,7 @@ public class HgMqUnAppliedPatchesPanel extends JPanel implements DataProvider, H
|
||||
@Override
|
||||
public void run() {
|
||||
ProgressManager.getInstance().getProgressIndicator().setText("Deleting patches...");
|
||||
new HgQDeleteCommand(myRepository).execute(names);
|
||||
new HgQDeleteCommand(myRepository).executeInCurrentThread(names);
|
||||
}
|
||||
};
|
||||
updatePatchSeriesInBackground(deleteTask);
|
||||
|
||||
Reference in New Issue
Block a user