diff --git a/core/src/main/java/hudson/scm/browsers/FishEyeSVN.java b/core/src/main/java/hudson/scm/browsers/FishEyeSVN.java index 619f71e621..8454d729f8 100644 --- a/core/src/main/java/hudson/scm/browsers/FishEyeSVN.java +++ b/core/src/main/java/hudson/scm/browsers/FishEyeSVN.java @@ -6,6 +6,7 @@ import hudson.scm.RepositoryBrowser; import hudson.scm.SubversionChangeLogSet.LogEntry; import hudson.scm.SubversionChangeLogSet.Path; import hudson.scm.SubversionRepositoryBrowser; +import hudson.scm.EditType; import hudson.util.FormFieldValidator; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; @@ -60,6 +61,8 @@ public class FishEyeSVN extends SubversionRepositoryBrowser { @Override public URL getDiffLink(Path path) throws IOException { + if(path.getEditType()!= EditType.EDIT) + return null; // no diff if this is not an edit change int r = path.getLogEntry().getRevision(); return new URL(url, getPath(path)+String.format("?r1=%d&r2=%d",r-1,r)); } diff --git a/core/src/main/java/hudson/scm/browsers/ViewSVN.java b/core/src/main/java/hudson/scm/browsers/ViewSVN.java index 5222f9a031..49b1b505ad 100644 --- a/core/src/main/java/hudson/scm/browsers/ViewSVN.java +++ b/core/src/main/java/hudson/scm/browsers/ViewSVN.java @@ -6,6 +6,7 @@ import hudson.scm.RepositoryBrowser; import hudson.scm.SubversionChangeLogSet; import hudson.scm.SubversionChangeLogSet.Path; import hudson.scm.SubversionRepositoryBrowser; +import hudson.scm.EditType; import org.kohsuke.stapler.StaplerRequest; import java.io.IOException; @@ -37,6 +38,8 @@ public class ViewSVN extends SubversionRepositoryBrowser { @Override public URL getDiffLink(Path path) throws IOException { + if(path.getEditType()!= EditType.EDIT) + return null; // no diff if this is not an edit change int r = path.getLogEntry().getRevision(); return new URL(url,trimHeadSlash(path.getValue())+param().add("r1="+(r-1)).add("r2="+r)); } diff --git a/core/src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly b/core/src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly index 9088687454..c748e5c02c 100644 --- a/core/src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly +++ b/core/src/main/resources/hudson/scm/SubversionChangeLogSet/index.jelly @@ -31,9 +31,10 @@