private static boolean existInBranch(@NotNull HgRepository repository,
                                       @NotNull FilePath path,
                                       @NotNull HgRevisionNumber compareWithRevisionNumber) {
    HgStatusCommand statusCommand = new HgStatusCommand.Builder(true).ignored(false).unknown(false).copySource(!path.isDirectory())
      .baseRevision(compareWithRevisionNumber).targetRevision(null).build(repository.getProject());
    statusCommand.cleanFilesOption(true);
    return !statusCommand.executeInCurrentThread(repository.getRoot(), Collections.singleton(path)).isEmpty();
  }
private static boolean existInBranch(@NotNull HgRepository repository,
                                       @NotNull FilePath path,
                                       @NotNull HgRevisionNumber compareWithRevisionNumber)