@Override
  protected void executeChunked(@NotNull List<List<String>> chunkedCommits) throws VcsException {
    if (chunkedCommits.isEmpty()) {
      commitChunkFiles(ContainerUtil.emptyList(), myAmend, myCloseBranch);
    }
    else {
      int size = chunkedCommits.size();
      if (myShouldCommitWithSubrepos && myRepository.hasSubrepos()) {
        mySubrepos = HgUtil.getNamesWithoutHashes(myRepository.getSubrepos());
      }
      commitChunkFiles(chunkedCommits.get(0), myAmend, !mySubrepos.isEmpty(), myCloseBranch && size == 1);
      HgVcs vcs = HgVcs.getInstance(myProject);
      boolean amendCommit = vcs != null && vcs.getVersion().isAmendSupported();
      for (int i = 1; i < size; i++) {
        List<String> chunk = chunkedCommits.get(i);
        commitChunkFiles(chunk, amendCommit, false, myCloseBranch && i == size - 1);
      }
    }
  }
@Override
  protected void executeChunked(@NotNull List<List<String>> chunkedCommits)