use of com.intellij.openapi.diff.impl.patch.apply.ApplyTextFilePatch in project intellij-community by JetBrains.
the class PatchApplier method actualApply.
@Nullable
private ApplyPatchStatus actualApply(final List<Pair<VirtualFile, ApplyTextFilePatch>> textPatches, final List<Pair<VirtualFile, ApplyFilePatchBase<BinaryType>>> binaryPatches, final CommitContext commitContext) {
final ApplyPatchContext context = new ApplyPatchContext(myBaseDirectory, 0, true, true);
ApplyPatchStatus status;
try {
status = applyList(textPatches, context, null, commitContext);
if (status == ApplyPatchStatus.ABORT)
return status;
if (myCustomForBinaries == null) {
status = applyList(binaryPatches, context, status, commitContext);
} else {
ApplyPatchStatus patchStatus = myCustomForBinaries.apply(binaryPatches);
final List<FilePatch> appliedPatches = myCustomForBinaries.getAppliedPatches();
moveForCustomBinaries(binaryPatches, appliedPatches);
status = ApplyPatchStatus.and(status, patchStatus);
myRemainingPatches.removeAll(appliedPatches);
}
} catch (IOException e) {
showError(myProject, e.getMessage());
return ApplyPatchStatus.ABORT;
}
return status;
}
Aggregations