mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-17 05:52:26 +00:00
bug fix.
git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@2611 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
1 parent
5b3b0017ce
commit
3a9553a28d
1 file changed
+17
-15
@@ -1,19 +1,17 @@
|
||||
package hudson.scm.browsers;
|
||||
|
||||
import hudson.scm.SubversionRepositoryBrowser;
|
||||
import hudson.model.Descriptor;
|
||||
import hudson.scm.ChangeLogSet.Entry;
|
||||
import hudson.scm.RepositoryBrowser;
|
||||
import hudson.scm.SubversionChangeLogSet;
|
||||
import hudson.scm.ChangeLogSet.Entry;
|
||||
import hudson.scm.SubversionChangeLogSet.Path;
|
||||
import hudson.model.Descriptor;
|
||||
|
||||
import java.net.URL;
|
||||
import java.net.MalformedURLException;
|
||||
import java.io.IOException;
|
||||
import java.text.MessageFormat;
|
||||
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
import hudson.scm.SubversionRepositoryBrowser;
|
||||
import static hudson.scm.browsers.ViewCVS.trimHeadSlash;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
/**
|
||||
* {@link RepositoryBrowser} for Subversion.
|
||||
@@ -26,6 +24,8 @@ public class ViewSVN extends SubversionRepositoryBrowser {
|
||||
* The URL of the top of the site.
|
||||
*
|
||||
* Normalized to ends with '/', like <tt>http://svn.apache.org/viewvc/</tt>
|
||||
* It may contain a query parameter like <tt>?root=foobar</tt>, so relative URL
|
||||
* construction needs to be done with care.
|
||||
*/
|
||||
public final URL url;
|
||||
|
||||
@@ -41,19 +41,21 @@ public class ViewSVN extends SubversionRepositoryBrowser {
|
||||
@Override
|
||||
public URL getDiffLink(Path path) throws IOException {
|
||||
int r = path.getLogEntry().getRevision();
|
||||
return new URL(getFileLink(path),
|
||||
MessageFormat.format("?r1={0}&r2={1}",r-1,r));
|
||||
return new URL(url,trimHeadSlash(path.getValue())+param().add("r1="+(r-1)).add("r2="+r));
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getFileLink(Path path) throws IOException {
|
||||
return new URL(url,trimHeadSlash(path.getValue()));
|
||||
return new URL(url,trimHeadSlash(path.getValue())+param());
|
||||
}
|
||||
|
||||
@Override
|
||||
public URL getChangeSetLink(Entry changeSet) throws IOException {
|
||||
return new URL(url,"?view=rev&revision="+
|
||||
((SubversionChangeLogSet.LogEntry)changeSet).getRevision());
|
||||
return new URL(url,"."+param().add("view=rev").add("revision="+((SubversionChangeLogSet.LogEntry)changeSet).getRevision()));
|
||||
}
|
||||
|
||||
private QueryBuilder param() {
|
||||
return new QueryBuilder(url.getQuery());
|
||||
}
|
||||
|
||||
public Descriptor<RepositoryBrowser> getDescriptor() {
|
||||
|
||||
Reference in new issue
Block a user