DiffRequestProducer (final Project project, final PatchReader patchReader) { PatchChange change = getChange(); FilePatch patch = getPatch(); String path = patch.getBeforeName() == null ? patch.getAfterName() : patch.getBeforeName(); return new DiffRequestProducer() { @NotNull @Override public DiffRequest process(@NotNull UserDataHolder context, @NotNull ProgressIndicator indicator) throws DiffRequestProducerException, ProcessCanceledException { if (myCurrentBase != null && FileTypeRegistry.getInstance().isFileOfType(myCurrentBase, UnknownFileType.INSTANCE)) { return new UnknownFileTypeDiffRequest(myCurrentBase, getName()); } if (isConflictingChange()) { final VirtualFile file = getCurrentBase(); ApplyPatchForBaseRevisionTexts texts = ApplyPatchForBaseRevisionTexts .create(project, file, VcsUtil.getFilePath(file), getPatch(), patchReader.getBaseRevision(path)); String afterTitle = getPatch().getAfterVersionId(); if (afterTitle == null) afterTitle = VcsBundle.message("patch.apply.conflict.patched.version"); return PatchDiffRequestFactory.createConflictDiffRequest(project, file, getPatch(), afterTitle, texts, getName()); } else { return PatchDiffRequestFactory.createDiffRequest(project, change, getName(), context, indicator); } } @NotNull @Override public String getName() { final File ioCurrentBase = getIoCurrentBase(); return ioCurrentBase == null ? getCurrentPath() : ioCurrentBase.getPath(); } @Override public @NotNull FileType getContentType() { return getFilePath().getFileType(); } }; }