void replay()

in src/main/java/com/googlesource/gerrit/plugins/importer/ReplayChangesStep.java [136:167]


  void replay()
      throws IOException, OrmException, NoSuchAccountException, NoSuchChangeException,
          RestApiException, UpdateException, ConfigInvalidException,
          PatchListNotAvailableException {
    int start = 0;
    int limit = GlobalCapability.DEFAULT_MAX_QUERY_LIMIT;
    pm.beginTask("Replay Changes", ProgressMonitor.UNKNOWN);
    for (; ; ) {
      List<ChangeInfo> changes = api.queryChanges(srcProject.get(), start, limit);
      if (changes.isEmpty()) {
        break;
      }
      start += changes.size();
      try (RevWalk rw = new RevWalk(repo)) {
        ChangeInfo last = null;
        for (ChangeInfo c : changes) {
          try {
            replayChange(rw, c);
          } catch (Exception e) {
            log.error(String.format("Failed to replay change %s.", Url.decode(c.id)), e);
            throw e;
          }
          last = c;
          pm.update(1);
        }
        if (!Boolean.TRUE.equals(last._moreChanges)) {
          break;
        }
      }
    }
    pm.endTask();
  }