From 11a4ce7de79c34fe9ecf9c94c7a5092adfe701bd Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Fri, 3 Nov 2017 17:23:02 +0300 Subject: [PATCH] diff: support annotations in 3 panel diff for merge commits IDEA-129759 --- .../actions/diff/ChangeDiffRequestProducer.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java index 6b34f36858f5..01d2fbbccee7 100644 --- a/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java +++ b/platform/vcs-impl/src/com/intellij/openapi/vcs/changes/actions/diff/ChangeDiffRequestProducer.java @@ -37,10 +37,7 @@ import com.intellij.openapi.diff.DiffBundle; import com.intellij.openapi.progress.ProcessCanceledException; import com.intellij.openapi.progress.ProgressIndicator; import com.intellij.openapi.project.Project; -import com.intellij.openapi.util.Comparing; -import com.intellij.openapi.util.Key; -import com.intellij.openapi.util.Ref; -import com.intellij.openapi.util.UserDataHolder; +import com.intellij.openapi.util.*; import com.intellij.openapi.vcs.*; import com.intellij.openapi.vcs.changes.*; import com.intellij.openapi.vcs.changes.ui.ChangeDiffRequestChain; @@ -395,16 +392,21 @@ public class ChangeDiffRequestProducer implements DiffRequestProducer, ChangeDif return contentFactory.create(project, vFile); } + DiffContent content; if (revision instanceof ByteBackedContentRevision) { byte[] revisionContent = ((ByteBackedContentRevision)revision).getContentAsBytes(); if (revisionContent == null) throw new DiffRequestProducerException("Can't get revision content"); - return contentFactory.createFromBytes(project, revisionContent, filePath); + content = contentFactory.createFromBytes(project, revisionContent, filePath); } else { String revisionContent = revision.getContent(); if (revisionContent == null) throw new DiffRequestProducerException("Can't get revision content"); - return contentFactory.create(project, revisionContent, filePath); + content = contentFactory.create(project, revisionContent, filePath); } + + content.putUserData(DiffUserDataKeysEx.REVISION_INFO, Pair.create(revision.getFile(), revision.getRevisionNumber())); + + return content; } catch (IOException | VcsException e) { LOG.info(e);