// Path: src/com/jetbrains/crucible/vcs/VcsUtils.java
// public class VcsUtils {
// 
//   private VcsUtils() {
//   }
// 
//   @Nullable
//   public static CommittedChangeList loadRevisions(@NotNull final Project project, final VcsRevisionNumber number, final FilePath filePath) {
//     final CommittedChangeList[] list = new CommittedChangeList[1];
//     final ThrowableRunnable<VcsException> runnable = () -> {
//       final AbstractVcs vcs = VcsUtil.getVcsFor(project, filePath);
// 
//       if (vcs == null) {
//         return;
//       }
// 
//       list[0] = vcs.loadRevisions(filePath.getVirtualFile(), number);
//     };
// 
//     final boolean success = VcsSynchronousProgressWrapper.wrap(runnable, project, "Load Revision Contents");
// 
//     return success ? list[0] : null;
//   }
// }


import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.jetbrains.crucible.vcs.VcsUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
package com.jetbrains.crucible.model;



/**
 *
 * User : ktisha
 */
public class ReviewItem {

  private String myId;
  private String myPath;
  private String myRepo;
  private Set<String> myRevisions = new HashSet<String>();

  public ReviewItem(@NotNull final String id, @NotNull final String path, @Nullable final String repo) {
    myId = id;
    myPath = path;
    myRepo = repo;
  }

  @NotNull
  public List<CommittedChangeList> loadChangeLists(@NotNull Project project, @NotNull AbstractVcs vcsFor,
                                                   @NotNull Set<String> loadedRevisions, FilePath path) throws VcsException {
    final Set<String> revisions = getRevisions();
    List<CommittedChangeList> changeLists = new ArrayList<CommittedChangeList>();
    for (String revision : revisions) {
      if (!loadedRevisions.contains(revision)) {
        final VcsRevisionNumber revisionNumber = vcsFor.parseRevisionNumber(revision);
        if (revisionNumber != null) {
// Path: src/com/jetbrains/crucible/vcs/VcsUtils.java
// public class VcsUtils {
// 
//   private VcsUtils() {
//   }
// 
//   @Nullable
//   public static CommittedChangeList loadRevisions(@NotNull final Project project, final VcsRevisionNumber number, final FilePath filePath) {
//     final CommittedChangeList[] list = new CommittedChangeList[1];
//     final ThrowableRunnable<VcsException> runnable = () -> {
//       final AbstractVcs vcs = VcsUtil.getVcsFor(project, filePath);
// 
//       if (vcs == null) {
//         return;
//       }
// 
//       list[0] = vcs.loadRevisions(filePath.getVirtualFile(), number);
//     };
// 
//     final boolean success = VcsSynchronousProgressWrapper.wrap(runnable, project, "Load Revision Contents");
// 
//     return success ? list[0] : null;
//   }
// }


// Path: src/com/jetbrains/crucible/model/ReviewItem.java
import com.intellij.openapi.project.Project;
import com.intellij.openapi.vcs.AbstractVcs;
import com.intellij.openapi.vcs.FilePath;
import com.intellij.openapi.vcs.VcsException;
import com.intellij.openapi.vcs.history.VcsRevisionNumber;
import com.intellij.openapi.vcs.versionBrowser.CommittedChangeList;
import com.jetbrains.crucible.vcs.VcsUtils;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

package com.jetbrains.crucible.model;



/**
 *
 * User : ktisha
 */
public class ReviewItem {

  private String myId;
  private String myPath;
  private String myRepo;
  private Set<String> myRevisions = new HashSet<String>();

  public ReviewItem(@NotNull final String id, @NotNull final String path, @Nullable final String repo) {
    myId = id;
    myPath = path;
    myRepo = repo;
  }

  @NotNull
  public List<CommittedChangeList> loadChangeLists(@NotNull Project project, @NotNull AbstractVcs vcsFor,
                                                   @NotNull Set<String> loadedRevisions, FilePath path) throws VcsException {
    final Set<String> revisions = getRevisions();
    List<CommittedChangeList> changeLists = new ArrayList<CommittedChangeList>();
    for (String revision : revisions) {
      if (!loadedRevisions.contains(revision)) {
        final VcsRevisionNumber revisionNumber = vcsFor.parseRevisionNumber(revision);
        if (revisionNumber != null) {
          final CommittedChangeList changeList = VcsUtils.loadRevisions(project, revisionNumber, path);