public void execute(boolean showTextOnIndicator, boolean isBinary, @NotNull HgLineProcessListener listener)
    throws ShellCommandException {
    ProgressIndicator indicator = ProgressManager.getInstance().getProgressIndicator();
    try {
      OSProcessHandler processHandler = isBinary
                                        ? new BinaryOSProcessHandler(myCommandLine)
                                        : new KillableProcessHandler(myCommandLine, Registry.is("hg4idea.execute.with.mediator"));
      ProcessAdapter outputAdapter = new ProcessAdapter() {
        @Override
        public void onTextAvailable(@NotNull ProcessEvent event, @NotNull Key outputType) {
          for (@NlsSafe String line : LineHandlerHelper.splitText(event.getText())) {
            if (ProcessOutputTypes.STDOUT == outputType && indicator != null && showTextOnIndicator) {
              indicator.setText2(line);
            }
            listener.onLineAvailable(line, outputType);
          }
        }

        @Override
        public void processTerminated(@NotNull ProcessEvent event) {
          listener.setExitCode(event.getExitCode());
        }
      };
      processHandler.addProcessListener(outputAdapter);
      processHandler.startNotify();
      while (!processHandler.waitFor(300)) {
        if (indicator != null && indicator.isCanceled()) {
          processHandler.destroyProcess();
          listener.setExitCode(255);
          break;
        }
      }
      if (isBinary) {
        listener.setBinaryOutput(((BinaryOSProcessHandler)processHandler).getOutput());
      }
    }
    catch (ExecutionException e) {
      throw new ShellCommandException(e);
    }
  }
public void execute(boolean showTextOnIndicator, boolean isBinary, @NotNull HgLineProcessListener listener)