@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); }
@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); }
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; }
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()); } } }
@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); } }
@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(); } }); }
public List<VirtualFile> getIndirectlyAffected() { return myVerifier.getAllAffected(); }
public List<FilePath> getDirectlyAffected() { return myVerifier.getDirectlyAffected(); }
protected void addSkippedItems(final TriggerAdditionOrDeletion trigger) { trigger.addExisting(myVerifier.getToBeAdded()); trigger.addDeleted(myVerifier.getToBeDeleted()); }
public void setIgnoreContentRootsCheck() { myVerifier.setIgnoreContentRootsCheck(true); }