Index: core/src/main/java/hudson/scm/SubversionChangeLogSet.java =================================================================== --- core/src/main/java/hudson/scm/SubversionChangeLogSet.java (revision 16390) +++ core/src/main/java/hudson/scm/SubversionChangeLogSet.java (working copy) @@ -26,6 +26,8 @@ import hudson.model.AbstractBuild; import hudson.model.User; import hudson.scm.SubversionChangeLogSet.LogEntry; +import hudson.scm.SubversionSCM.ModuleLocation; + import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.export.ExportedBean; @@ -154,13 +156,48 @@ public Collection getAffectedPaths() { return new AbstractList() { public String get(int index) { - return paths.get(index).value; + return preparePath(paths.get(index).value); } public int size() { return paths.size(); } }; } + + private String preparePath(String path) { + SubversionSCM scm = (SubversionSCM) getParent().build.getProject().getScm(); + ModuleLocation[] locations = scm.getLocations(); + for (int i = 0; i < locations.length; i++) { + String commonPart = findCommonPart(locations[i].remote, path); + if (commonPart != null) { + if (path.startsWith("/")) { + path = path.substring(1); + } + String newPath = path.substring(commonPart.length()); + if (newPath.startsWith("/")) { + newPath = newPath.substring(1); + } + return newPath; + } + } + return path; + } + + private String findCommonPart(String folder, String filePath) { + if (folder == null || filePath == null) { + return null; + } + if (filePath.startsWith("/")) { + filePath = filePath.substring(1); + } + for (int i = 0; i < folder.length(); i++) { + String part = folder.substring(i); + if (filePath.startsWith(part)) { + return part; + } + } + return null; + } public void setUser(String author) { this.author = User.get(author);