use of org.zmlx.hg4idea.command.HgInitCommand in project intellij-community by JetBrains.
the class HgIntegrationEnabler method initOrNotifyError.
@Override
protected boolean initOrNotifyError(@NotNull final VirtualFile projectDir) {
final boolean[] success = new boolean[1];
new HgInitCommand(myProject).executeAsynchronously(projectDir, new HgCommandResultHandler() {
@Override
public void process(@Nullable HgCommandResult result) {
VcsNotifier notifier = VcsNotifier.getInstance(myProject);
if (!HgErrorUtil.hasErrorsInCommandExecution(result)) {
success[0] = true;
refreshVcsDir(projectDir, HgUtil.DOT_HG);
notifier.notifySuccess(message("hg4idea.init.created.notification.title"), message("hg4idea.init.created.notification.description", projectDir.getPresentableUrl()));
} else {
success[0] = false;
String errors = result != null ? result.getRawError() : "";
notifier.notifyError(message("hg4idea.init.error.description", projectDir.getPresentableUrl()), errors);
}
}
});
return success[0];
}
Aggregations