From 3dc8e09070f39715a8c8ab364806d33a16ee08d5 Mon Sep 17 00:00:00 2001 From: Aleksey Pivovarov Date: Tue, 25 Apr 2017 18:39:12 +0300 Subject: [PATCH] vcs: implement ByteBackedContentRevision in LocalHistory --- .../intellij/history/core/revisions/Difference.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java b/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java index 582428ec7c04..acadd30bfc55 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java @@ -20,6 +20,7 @@ import com.intellij.history.core.tree.Entry; import com.intellij.history.integration.IdeaGateway; import com.intellij.openapi.vcs.FilePath; import com.intellij.openapi.vcs.VcsException; +import com.intellij.openapi.vcs.changes.ByteBackedContentRevision; import com.intellij.openapi.vcs.changes.ContentRevision; import com.intellij.openapi.vcs.history.VcsRevisionNumber; import com.intellij.vcsUtil.VcsUtil; @@ -62,13 +63,20 @@ public class Difference { private ContentRevision createContentRevision(final Entry e, final IdeaGateway gw) { if (e == null) return null; - return new ContentRevision() { + return new ByteBackedContentRevision() { @Nullable public String getContent() throws VcsException { if (e.isDirectory()) return null; return e.getContent().getString(e, gw); } + @Nullable + @Override + public byte[] getContentAsBytes() throws VcsException { + if (e.isDirectory()) return null; + return e.getContent().getBytes(); + } + @NotNull public FilePath getFile() { return VcsUtil.getFilePath(new File(e.getPath()), e.isDirectory());