mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: implement ByteBackedContentRevision in LocalHistory
This commit is contained in:
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user