mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
hg: fix Synchronous hg version check on EDT:
Run under modal task as it performed for Git GitOrigin-RevId: 3c7ad2ba84cc93baf19c29502023136432a3933d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
cb69f4c7d3
commit
0a10680ac7
@@ -16,6 +16,8 @@ import com.intellij.dvcs.branch.DvcsSyncSettings;
|
||||
import com.intellij.dvcs.ui.DvcsBundle;
|
||||
import com.intellij.openapi.components.ServiceManager;
|
||||
import com.intellij.openapi.options.ConfigurableUi;
|
||||
import com.intellij.openapi.progress.ProgressIndicator;
|
||||
import com.intellij.openapi.progress.Task;
|
||||
import com.intellij.openapi.progress.util.BackgroundTaskUtil;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
@@ -75,17 +77,30 @@ public class HgConfigurationProjectPanel implements ConfigurableUi<HgProjectConf
|
||||
}
|
||||
|
||||
private void testExecutable(@NotNull String executable) {
|
||||
HgVersion version;
|
||||
try {
|
||||
version = HgVersion.identifyVersion(executable);
|
||||
}
|
||||
catch (Exception exception) {
|
||||
Messages.showErrorDialog(myMainPanel, exception.getMessage(), HgVcsMessages.message("hg4idea.run.failed.title"));
|
||||
return;
|
||||
}
|
||||
Messages.showInfoMessage(myMainPanel, String.format("Mercurial version is %s", version.toString()),
|
||||
HgVcsMessages.message("hg4idea.run.success.title")
|
||||
);
|
||||
new Task.Modal(myProject, "Identifying Mercurial Version", true) {
|
||||
HgVersion version;
|
||||
|
||||
@Override
|
||||
public void run(@NotNull ProgressIndicator indicator) {
|
||||
try {
|
||||
version = HgVersion.identifyVersion(executable);
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess() {
|
||||
Messages.showInfoMessage(myMainPanel, String.format("Mercurial version is %s", version.toString()),
|
||||
HgVcsMessages.message("hg4idea.run.success.title"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onThrowable(@NotNull Throwable error) {
|
||||
Messages.showErrorDialog(myMainPanel, error.getCause().getMessage(), HgVcsMessages.message("hg4idea.run.failed.title"));
|
||||
}
|
||||
}.queue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user