State (@NotNull State state, boolean resetCommitCount, @NotNull List<MoreCommitsRequest> moreCommitsRequests) { DataPack dataPack = myLogData.getDataPack(); if (dataPack == DataPack.EMPTY && !myVcsLogFilterer.canFilterEmptyPack(state.getFilters())) { // 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(CommitCountStage.INITIAL); } 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.getSortType(), state.getFilters(), state.getCommitCount()); return state.withVisiblePack(pair.getFirst()).withCommitCount(pair.getSecond()); } catch (ProcessCanceledException e) { throw e; } catch (Throwable t) { return state.withVisiblePack(new VisiblePack.ErrorVisiblePack(dataPack, state.getFilters(), t)); } finally { VcsLogProgress.updateCurrentKey(new VisiblePackProgressKey(myLogId, false)); } }