diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java index a615fd4e3afa..e40569d720de 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/annotate/SvnAnnotationProvider.java @@ -70,7 +70,7 @@ public class SvnAnnotationProvider implements AnnotationProvider, VcsCacheableAn if (! svnRevision.isValid()) { throw new VcsException("Can not get last changed revision for file: " + file.getPath() + "\nPlease run svn info for this file and file an issue."); } - return annotate(file, new SvnFileRevision(myVcs, currentRevision, currentRevision, null, null, null, null, null, file.getCharset()), + return annotate(file, new SvnFileRevision(myVcs, currentRevision, currentRevision, null, null, null, null, null), lastChangedRevision.getRevisionNumber(), true); } @@ -438,7 +438,7 @@ public class SvnAnnotationProvider implements AnnotationProvider, VcsCacheableAn myProgress.checkCanceled(); myProgress.setText2(SvnBundle.message("progress.text2.revision.processed", logEntry.getRevision())); } - myResult.setRevision(logEntry.getRevision(), new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, myUrl, "", myCharset)); + myResult.setRevision(logEntry.getRevision(), new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, myUrl, "")); } }); } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java index 163be4922224..f7e54a64f0ad 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/dialogs/RepositoryBrowserComponent.java @@ -266,7 +266,7 @@ public class RepositoryBrowserComponent extends JPanel implements Disposable, Da if (entry.getName().lastIndexOf('.') > 0 && !manager.getFileTypeByFileName(name).isBinary()) { SVNURL url = node.getURL(); final SvnFileRevision revision = new SvnFileRevision(myVCS, SVNRevision.UNDEFINED, SVNRevision.HEAD, url.toString(), - entry.getAuthor(), entry.getDate(), null, null, null); + entry.getAuthor(), entry.getDate(), null, null); return new VcsVirtualFile(node.getSVNDirEntry().getName(), revision, VcsFileSystem.getInstance()); } else { 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 007df92a403b..b44d5ce73e31 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnFileRevision.java @@ -22,10 +22,10 @@ import com.intellij.openapi.progress.ProgressManager; import com.intellij.openapi.util.Throwable2Computable; import com.intellij.openapi.vcs.RepositoryLocation; import com.intellij.openapi.vcs.VcsException; -import com.intellij.openapi.vcs.actions.VcsContextFactory; import com.intellij.openapi.vcs.history.VcsFileRevision; import com.intellij.openapi.vcs.history.VcsRevisionNumber; import com.intellij.openapi.vcs.impl.ContentRevisionCache; +import com.intellij.vcsUtil.VcsUtil; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.jetbrains.idea.svn.SvnBundle; @@ -37,7 +37,6 @@ import org.tmatesoft.svn.core.wc.SVNRevision; import org.tmatesoft.svn.core.wc2.SvnTarget; import java.io.IOException; -import java.nio.charset.Charset; import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -55,7 +54,6 @@ public class SvnFileRevision implements VcsFileRevision { private final SVNRevision myRevision; private final String myCopyFromPath; private final List myMergeSources; - private final Charset myCharset; public SvnFileRevision(SvnVcs vcs, SVNRevision pegRevision, @@ -64,8 +62,7 @@ public class SvnFileRevision implements VcsFileRevision { String author, Date date, String commitMessage, - String copyFromPath, Charset charset) { - myCharset = charset; + String copyFromPath) { myRevisionNumber = new SvnRevisionNumber(revision); myPegRevision = pegRevision; myRevision = revision; @@ -82,8 +79,7 @@ public class SvnFileRevision implements VcsFileRevision { SVNRevision pegRevision, LogEntry logEntry, String url, - String copyFromPath, Charset charset) { - myCharset = charset; + String copyFromPath) { final SVNRevision revision = SVNRevision.create(logEntry.getRevision()); myRevisionNumber = new SvnRevisionNumber(revision); myPegRevision = pegRevision; @@ -155,28 +151,26 @@ public class SvnFileRevision implements VcsFileRevision { else { loader.run(); } - if (loader.getException() == null) { + + VcsException exception = loader.getException(); + if (exception == null) { final byte[] contents = loader.getContents(); ContentRevisionCache.checkContentsSize(myURL, contents.length); return contents; } else { - final VcsException vcsException = loader.getException(); - LOG.info("Failed to load file '" + myURL + "' content at revision: " + myRevision + "\n" + vcsException.getMessage(), vcsException); - throw vcsException; + LOG.info("Failed to load file '" + myURL + "' content at revision: " + myRevision + "\n" + exception.getMessage(), exception); + throw exception; } } public byte[] getContent() throws IOException, VcsException { - return ContentRevisionCache.getOrLoadAsBytes(myVCS.getProject(), VcsContextFactory.SERVICE.getInstance() - .createFilePathOnNonLocal(myURL, false), - getRevisionNumber(), myVCS.getKeyInstanceMethod(), ContentRevisionCache.UniqueType.REMOTE_CONTENT, + 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 { - byte[] bytes = loadContent(); - return bytes; - //return SvnUtil.decode(myCharset, bytes); + return loadContent(); } }); } diff --git a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java index b23b57772535..2ff19fcc56e6 100644 --- a/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java +++ b/plugins/svn4idea/src/org/jetbrains/idea/svn/history/SvnHistoryProvider.java @@ -614,7 +614,7 @@ public class SvnHistoryProvider final SVNURL url = myRepositoryRoot.appendPath(myLastPath, true); // final SVNURL url = entryPath != null ? myRepositoryRoot.appendPath(entryPath.getPath(), true) : // myRepositoryRoot.appendPath(myLastPathCorrector.getBefore(), false); - return new SvnFileRevision(myVcs, myPegRevision, rev, url.toString(), author, date, message, copyPath, myCharset); + return new SvnFileRevision(myVcs, myPegRevision, rev, url.toString(), author, date, message, copyPath); } } @@ -633,7 +633,7 @@ public class SvnHistoryProvider throws SVNException { final SVNURL url = entryPath == null ? myRepositoryRoot.appendPath(myLastPathCorrector.getBefore(), false) : myRepositoryRoot.appendPath(entryPath.getPath(), true); - return new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, url.toString(), copyPath, null); + return new SvnFileRevision(myVcs, SVNRevision.UNDEFINED, logEntry, url.toString(), copyPath); } }