From 42d4f5f725dec7ccef6980bdfbde27bf0cb20a87 Mon Sep 17 00:00:00 2001 From: Stephen Elsemore Date: Thu, 9 Apr 2015 09:12:48 +0200 Subject: [PATCH] Support absolute path (URL) for diff base References #139 Signed-off-by: Robert Munteanu --- .../actions/SubclipseSCMFileContentsLocator.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/org.review_board.ereviewboard.subclipse.core/src/org/review_board/ereviewboard/subclipse/core/internal/actions/SubclipseSCMFileContentsLocator.java b/org.review_board.ereviewboard.subclipse.core/src/org/review_board/ereviewboard/subclipse/core/internal/actions/SubclipseSCMFileContentsLocator.java index 59f55e7..66dc4e6 100644 --- a/org.review_board.ereviewboard.subclipse.core/src/org/review_board/ereviewboard/subclipse/core/internal/actions/SubclipseSCMFileContentsLocator.java +++ b/org.review_board.ereviewboard.subclipse.core/src/org/review_board/ereviewboard/subclipse/core/internal/actions/SubclipseSCMFileContentsLocator.java @@ -13,6 +13,8 @@ import java.io.IOException; import java.io.InputStream; +import java.net.MalformedURLException; +import java.net.URL; import java.text.ParseException; import org.apache.commons.io.IOUtils; @@ -63,7 +65,14 @@ public byte[] getContents(IProgressMonitor monitor) throws CoreException{ Activator.getDefault().trace(TraceLocation.MAIN, "Retrieving file " + _filePath + " @ " + _revision + " from repo " + repoLocation.getLabel() + " ( " + repoLocation.getLocation() + " )"); - SVNUrl resourceUrl = repoLocation.getUrl().appendPath(_filePath); + SVNUrl resourceUrl; + try { + new URL(_filePath); + resourceUrl = new SVNUrl(_filePath); + } + catch (MalformedURLException ex) { + resourceUrl = repoLocation.getUrl().appendPath(_filePath); + } SVNRevision revision = SVNRevision.getRevision(_revision); InputStream content = repoLocation.getSVNClient().getContent(resourceUrl, revision);