@NotNull
  private ApplyPatchStatus executeWritable() {
    try (AccessToken ignore = SlowOperations.knownIssue("IDEA-305053, EA-659443")) {
      ReadonlyStatusHandler.OperationStatus readOnlyFilesStatus =
        ReadonlyStatusHandler.getInstance(myProject).ensureFilesWritable(myVerifier.getWritableFiles());
      if (readOnlyFilesStatus.hasReadonlyFiles()) {
        showError(myProject, readOnlyFilesStatus.getReadonlyFilesMessage());
        return ApplyPatchStatus.ABORT;
      }
    }

    myFailedPatches.addAll(myVerifier.filterBadFileTypePatches());
    ApplyPatchStatus initStatus = myFailedPatches.isEmpty() ? null : ApplyPatchStatus.FAILURE;

    List<PatchAndFile> textPatches = myVerifier.getTextPatches();
    List<PatchAndFile> binaryPatches = myVerifier.getBinaryPatches();

    ApplyPatchStatus applyStatus;
    try {
      markInternalOperation(textPatches, true);
      applyStatus = actualApply(ContainerUtil.concat(textPatches, binaryPatches), myCommitContext);
    }
    finally {
      markInternalOperation(textPatches, false);
    }

    ApplyPatchStatus status = ApplyPatchStatus.and(initStatus, applyStatus);
    return ObjectUtils.notNull(status, ApplyPatchStatus.SUCCESS); // return SUCCESS if nothing was done
  }
@NotNull
  private ApplyPatchStatus executeWritable()