@NotNull
  @CalledInAny
  public static DiffRequest createConflictDiffRequest(@Nullable Project project,
                                                      @Nullable VirtualFile file,
                                                      @NotNull TextFilePatch patch,
                                                      @NotNull @NlsContexts.Label String afterTitle,
                                                      @NotNull final ApplyPatchForBaseRevisionTexts texts,
                                                      @NotNull String name)
    throws DiffRequestProducerException {
    if (file == null) throw new DiffRequestProducerException(VcsBundle.message("changes.error.can.t.show.diff.for",  name));

    if (file.getFileType().isBinary()) {
      throw new DiffRequestProducerException(VcsBundle.message("changes.error.can.t.show.diff.for.binary.file", name));
    }

    if (texts.getBase() == null) {
      String localContent = texts.getLocal();

      final GenericPatchApplier applier = new GenericPatchApplier(localContent, patch.getHunks());
      applier.execute();

      final AppliedTextPatch appliedTextPatch = AppliedTextPatch.create(applier.getAppliedInfo());
      return createBadDiffRequest(project, file, localContent, appliedTextPatch, null, null,
                                  DiffBundle.message("merge.version.title.current"), null);
    }
    else {
      String localContent = texts.getLocal();
      String baseContent = texts.getBase();
      String patchedContent = texts.getPatched();

      return createDiffRequest(project, file, Arrays.asList(localContent, baseContent, patchedContent), null,
                               Arrays.asList(DiffBundle.message("merge.version.title.current"), DiffBundle.message("merge.version.title.base"),
                                             afterTitle));
    }
  }
@NotNull
  @CalledInAny
  public static DiffRequest createConflictDiffRequest(@Nullable Project project,
                                                      @Nullable VirtualFile file,
                                                      @NotNull TextFilePatch patch,
                                                      @NotNull @NlsContexts.Label String afterTitle,
                                                      @NotNull final ApplyPatchForBaseRevisionTexts texts,
                                                      @NotNull String name)