int (final @NotNull Project project, @NotNull @NlsContexts.DialogTitle String confirmationMessage) { final AtomicInteger exitCode = new AtomicInteger(); UIUtil.invokeAndWaitIfNeeded(() -> { exitCode.set(Messages.showOkCancelDialog(project, confirmationMessage, HgBundle.message("hg4idea.update.uncommitted.problem"), HgBundle.message("changes.discard"), CommonBundle.message("button.cancel.c"), Messages.getWarningIcon())); }); return exitCode.get(); }