public static @NotNull HgCommandResult getVersionOutput(@NotNull Project project, @NotNull String executable) throws ShellCommandException {
    if (!project.isDefault() && !TrustedProjects.isTrusted(project)) {
      throw new ShellCommandException("Can't run a Hg command in the safe mode");
    }

    String hgExecutable = executable.trim();
    List<String> cmdArgs = new ArrayList<>();
    cmdArgs.add(hgExecutable);
    cmdArgs.add("version");
    cmdArgs.add("-q");
    ShellCommand shellCommand = new ShellCommand(cmdArgs, null, CharsetToolkit.getDefaultSystemCharset());
    return shellCommand.execute(false, false);
  }
public static @NotNull HgCommandResult getVersionOutput(@NotNull Project project, @NotNull String executable)