[FIXED HUDSON-5357] Properly handle relative paths in modules when determining changesets in Maven projects

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@34983 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
abayer committed 2010-09-18 22:10:36 +00:00
1 parent b75a802190
commit 119d8aa286
4 files changed
+48 -4

No files matched your search

@@ -50,6 +50,7 @@ import org.apache.maven.project.MavenProject;
import org.apache.maven.project.ProjectBuildingException;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.apache.commons.io.FilenameUtils;
import java.io.*;
import java.util.*;
@@ -164,7 +165,7 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
private boolean belongsToSubsidiary(List<MavenModule> subsidiaries, String path) {
for (MavenModule sub : subsidiaries)
if(path.startsWith(sub.getRelativePath()))
if(path.startsWith(FilenameUtils.normalize(sub.getRelativePath())))
return true;
return false;
}
@@ -173,9 +174,10 @@ public class MavenModuleSetBuild extends AbstractMavenBuild<MavenModuleSet,Maven
* Does this change happen somewhere in the given module or its descendants?
*/
private boolean isDescendantOf(ChangeLogSet.Entry e, MavenModule mod) {
for (String path : e.getAffectedPaths())
if(path.startsWith(mod.getRelativePath()))
for (String path : e.getAffectedPaths()) {
if(path.startsWith(FilenameUtils.normalize(mod.getRelativePath())))
return true;
}
return false;
}
};