Skip to content
Permalink
Browse files

fixed JENKINS-18283 : Wrong URL in diff

  • Loading branch information...
ducquoc committed Jun 14, 2013
1 parent 6f5be78 commit 93e996630c54211e8fe0ddfa769bc0e929e76060
Showing with 12 additions and 2 deletions.
  1. +12 −2 src/main/java/hudson/plugins/viewVC/ViewVCRepositoryBrowser.java
@@ -63,12 +63,22 @@ public URL getUrl() {

@Override
public URL getDiffLink(Path path) throws IOException {
return new URL(getUrl(), String.format(DIFF_FORMAT, path.getValue(), getLocation(), path.getLogEntry().getRevision() - 1, path.getLogEntry().getRevision()));
String baseUrl = getUrl().toString();
// eliminate trailing slash since the SVN path already has it
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
return new URL(baseUrl + String.format(DIFF_FORMAT, path.getValue(), getLocation(), path.getLogEntry().getRevision() - 1, path.getLogEntry().getRevision()));
}

@Override
public URL getFileLink(Path path) throws IOException {
return new URL(getUrl(), String.format(FILE_FORMAT, path.getValue(), getLocation()));
String baseUrl = getUrl().toString();
// eliminate trailing slash since the SVN path already has it
if (baseUrl.endsWith("/")) {
baseUrl = baseUrl.substring(0, baseUrl.length() - 1);
}
return new URL(baseUrl + String.format(FILE_FORMAT, path.getValue(), getLocation()));
}

@Override

0 comments on commit 93e9966

Please sign in to comment.
You can’t perform that action at this time.