private @NotNull State refresh(@NotNull State state,
                                   boolean resetCommitCount,
                                   @NotNull List<MoreCommitsRequest> moreCommitsRequests) {
      DataPack dataPack = myDataPack;

      VcsLogFilterCollection filters = state.getFilters();

      if (dataPack == DataPack.EMPTY && !myVcsLogFilterer.canFilterEmptyPack(filters)) {
        // when filter is set during initialization, just remember filters
        // unless our builder can do something with an empty pack, for example in file history
        return state;
      }

      if (resetCommitCount) {
        state = state.withCommitCount(myVcsLogFilterer.getInitialCommitCount());
      }
      else if (!moreCommitsRequests.isEmpty()) {
        state = state.withCommitCount(state.getCommitCount().next());
      }

      VcsLogProgress.updateCurrentKey(new VisiblePackProgressKey(myLogId, resetCommitCount ||
                                                                          state.getVisiblePack().getDataPack() != dataPack ||
                                                                          moreCommitsRequests.isEmpty()));

      try {
        Pair<VisiblePack, CommitCountStage> pair = myVcsLogFilterer.filter(dataPack, state.getVisiblePack(), state.getGraphOptions(),
                                                                           filters, state.getCommitCount());
        VisiblePack visiblePack = pair.getFirst();
        CommitCountStage commitCount = pair.getSecond();
        if (dataPack instanceof SmallDataPack) {
          visiblePack = CompoundVisiblePack.build(visiblePack, state.getVisiblePack());
        }
        return state.withVisiblePack(visiblePack).withCommitCount(commitCount);
      }
      catch (ProcessCanceledException e) {
        throw e;
      }
      catch (Throwable t) {
        return state.withVisiblePack(new VisiblePack.ErrorVisiblePack(dataPack, filters, t));
      }
      finally {
        VcsLogProgress.updateCurrentKey(new VisiblePackProgressKey(myLogId, false));
      }
    }
private @NotNull State refresh(@NotNull State state,
                                   boolean resetCommitCount,
                                   @NotNull List<MoreCommitsRequest> moreCommitsRequests)