Ejemplo n.º 1
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();
         }
       });
 }
Ejemplo n.º 2
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);
   }
 }