void () { final String executable = HgExecutableManager.getInstance().getHgExecutable(myProject); VcsNotifier vcsNotifier = VcsNotifier.getInstance(myProject); final String SETTINGS_LINK = "settings"; final String UPDATE_LINK = "update"; NotificationListener linkAdapter = new NotificationListener.Adapter() { @Override protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { if (SETTINGS_LINK.equals(e.getDescription())) { ShowSettingsUtil.getInstance().showSettingsDialog(myProject, HgProjectConfigurable.class); } else if (UPDATE_LINK.equals(e.getDescription())) { BrowserUtil.browse("http://mercurial.selenic.com"); } } }; try { myVersion = HgVersion.identifyVersion(myProject, executable); //if version is not supported, but have valid hg executable if (!myVersion.isSupported()) { LOG.info("Unsupported Hg version: " + myVersion); String message = HgBundle.message("hg4idea.version.update", SETTINGS_LINK, myVersion, HgVersion.MIN, UPDATE_LINK); vcsNotifier.notifyError(UNSUPPORTED_VERSION, HgBundle.message("hg4idea.version.unsupported"), message, linkAdapter); } else if (myVersion.hasUnsupportedExtensions()) { String unsupportedExtensionsAsString = myVersion.getUnsupportedExtensions().toString(); LOG.warn("Unsupported Hg extensions: " + unsupportedExtensionsAsString); String message = HgBundle.message("hg4idea.version.unsupported.ext", unsupportedExtensionsAsString); vcsNotifier.notifyWarning(UNSUPPORTED_EXT, HgBundle.message("hg4idea.version.unsupported"), message); } } catch (Exception e) { if (getExecutableValidator().checkExecutableAndNotifyIfNeeded()) { //sometimes not hg application has version command, but we couldn't parse an answer as valid hg, // so parse(output) throw ParseException, but hg and git executable seems to be valid in this case final String reason = (e.getCause() != null ? e.getCause() : e).getMessage(); String message = HgBundle.message("hg4idea.unable.to.run.hg", executable); vcsNotifier.notifyError(UNABLE_TO_RUN_EXEC, message, HgBundle.message("hg4idea.exec.not.found", reason, SETTINGS_LINK), linkAdapter ); } } }