From 2ee2960bbed0510c8d4cdddd7a1c1ef3dc120cc2 Mon Sep 17 00:00:00 2001 From: Konstantin Kolosovsky Date: Thu, 14 Aug 2014 17:39:19 +0400 Subject: [PATCH] IDEA-102641 Do not cache file revision content (in ContentRevisionCache) if revision number is explicitly set to HEAD --- .../idea/svn/history/SvnFileRevision.java | 25 +++++++++++++------ 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java index b44d5ce73e31..e636c9c0a8ef 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java @@ -165,14 +165,23 @@ public class SvnFileRevision implements VcsFileRevision { } public byte[] getContent() throws IOException, VcsException { - return ContentRevisionCache.getOrLoadAsBytes(myVCS.getProject(), VcsUtil.getFilePathOnNonLocal(myURL, false), getRevisionNumber(), - myVCS.getKeyInstanceMethod(), ContentRevisionCache.UniqueType.REMOTE_CONTENT, - new Throwable2Computable() { - @Override - public byte[] compute() throws VcsException, IOException { - return loadContent(); - } - }); + byte[] result; + + if (SVNRevision.HEAD.equals(myRevision)) { + result = loadContent(); + } + else { + result = ContentRevisionCache.getOrLoadAsBytes(myVCS.getProject(), VcsUtil.getFilePathOnNonLocal(myURL, false), getRevisionNumber(), + myVCS.getKeyInstanceMethod(), ContentRevisionCache.UniqueType.REMOTE_CONTENT, + new Throwable2Computable() { + @Override + public byte[] compute() throws VcsException, IOException { + return loadContent(); + } + }); + } + + return result; } public String getCopyFromPath() {