コード例 #1
0
  @CalledInAwt
  protected void refreshFiles(final Collection<FilePath> additionalDirectly) {
    final List<FilePath> directlyAffected = myVerifier.getDirectlyAffected();
    final List<VirtualFile> indirectlyAffected = myVerifier.getAllAffected();
    directlyAffected.addAll(additionalDirectly);

    refreshPassedFilesAndMoveToChangelist(
        myProject, directlyAffected, indirectlyAffected, myToTargetListsMover);
  }
コード例 #2
0
 @NotNull
 public ApplyPatchStatus nonWriteActionPreCheck() {
   final List<FilePatch> failedPreCheck = myVerifier.nonWriteActionPreCheck();
   myFailedPatches.addAll(failedPreCheck);
   myPatches.removeAll(failedPreCheck);
   final List<FilePatch> skipped = myVerifier.getSkipped();
   final boolean applyAll = skipped.isEmpty();
   myPatches.removeAll(skipped);
   if (!failedPreCheck.isEmpty()) return ApplyPatchStatus.FAILURE;
   return applyAll
       ? ApplyPatchStatus.SUCCESS
       : ((skipped.size() == myPatches.size())
           ? ApplyPatchStatus.ALREADY_APPLIED
           : ApplyPatchStatus.PARTIAL);
 }
コード例 #3
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;
  }
コード例 #4
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());
     }
   }
 }
コード例 #5
0
 @Nullable
 protected ApplyPatchStatus executeWritable() {
   final ReadonlyStatusHandler.OperationStatus readOnlyFilesStatus =
       getReadOnlyFilesStatus(myVerifier.getWritableFiles());
   if (readOnlyFilesStatus.hasReadonlyFiles()) {
     showError(myProject, readOnlyFilesStatus.getReadonlyFilesMessage(), true);
     return ApplyPatchStatus.ABORT;
   }
   myFailedPatches.addAll(myVerifier.filterBadFileTypePatches());
   ApplyPatchStatus result = myFailedPatches.isEmpty() ? null : ApplyPatchStatus.FAILURE;
   final List<Pair<VirtualFile, ApplyTextFilePatch>> textPatches = myVerifier.getTextPatches();
   try {
     markInternalOperation(textPatches, true);
     return ApplyPatchStatus.and(
         result, actualApply(textPatches, myVerifier.getBinaryPatches(), myCommitContext));
   } finally {
     markInternalOperation(textPatches, false);
   }
 }
コード例 #6
0
 @NotNull
 public List<BinaryType> getBinaryPatches() {
   return ContainerUtil.mapNotNull(
       myVerifier.getBinaryPatches(),
       new Function<Pair<VirtualFile, ApplyFilePatchBase<BinaryType>>, BinaryType>() {
         @Override
         public BinaryType fun(Pair<VirtualFile, ApplyFilePatchBase<BinaryType>> patchInfo) {
           return patchInfo.getSecond().getPatch();
         }
       });
 }
コード例 #7
0
 public List<VirtualFile> getIndirectlyAffected() {
   return myVerifier.getAllAffected();
 }
コード例 #8
0
 public List<FilePath> getDirectlyAffected() {
   return myVerifier.getDirectlyAffected();
 }
コード例 #9
0
 protected void addSkippedItems(final TriggerAdditionOrDeletion trigger) {
   trigger.addExisting(myVerifier.getToBeAdded());
   trigger.addDeleted(myVerifier.getToBeDeleted());
 }
コード例 #10
0
 public void setIgnoreContentRootsCheck() {
   myVerifier.setIgnoreContentRootsCheck(true);
 }