Exemplo n.º 1
0
  private <V extends FilePatch, T extends ApplyFilePatchBase<V>> ApplyPatchStatus applyList(
      final List<Pair<VirtualFile, T>> patches,
      final ApplyPatchContext context,
      ApplyPatchStatus status,
      CommitContext commiContext)
      throws IOException {
    for (Pair<VirtualFile, T> patch : patches) {
      ApplyPatchStatus patchStatus =
          ApplyPatchAction.applyOnly(
              myProject,
              patch.getSecond(),
              context,
              patch.getFirst(),
              commiContext,
              myReverseConflict,
              myLeftConflictPanelTitle,
              myRightConflictPanelTitle);

      if (patchStatus == ApplyPatchStatus.ABORT) return patchStatus;
      status = ApplyPatchStatus.and(status, patchStatus);
      if (patchStatus == ApplyPatchStatus.FAILURE) {
        myFailedPatches.add(patch.getSecond().getPatch());
        continue;
      }
      if (patchStatus != ApplyPatchStatus.SKIP) {
        myVerifier.doMoveIfNeeded(patch.getFirst());
        myRemainingPatches.remove(patch.getSecond().getPatch());
      }
    }
    return status;
  }
Exemplo n.º 2
0
 private void moveForCustomBinaries(
     final List<Pair<VirtualFile, ApplyFilePatchBase<BinaryType>>> patches,
     final List<FilePatch> appliedPatches)
     throws IOException {
   for (Pair<VirtualFile, ApplyFilePatchBase<BinaryType>> patch : patches) {
     if (appliedPatches.contains(patch.getSecond().getPatch())) {
       myVerifier.doMoveIfNeeded(patch.getFirst());
     }
   }
 }