From 79c743ae9473a8a334303a4ea78882653cec692d Mon Sep 17 00:00:00 2001 From: jglick Date: Mon, 20 Nov 2006 12:15:23 +0000 Subject: [PATCH] Fix for projects which have a "bootstrap" checkout which then runs its own checkout e.g. from Ant. Hudson will now correctly compute changelogs for the extra modules. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1201 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/main/java/hudson/scm/CVSSCM.java | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/hudson/scm/CVSSCM.java b/core/src/main/java/hudson/scm/CVSSCM.java index 9749510045..1ef2509fe8 100644 --- a/core/src/main/java/hudson/scm/CVSSCM.java +++ b/core/src/main/java/hudson/scm/CVSSCM.java @@ -19,6 +19,7 @@ import hudson.org.apache.tools.ant.taskdefs.cvslib.ChangeLogTask; import hudson.util.ArgumentListBuilder; import hudson.util.ForkOutputStream; import hudson.util.FormFieldValidator; +import java.util.Collections; import org.apache.tools.ant.BuildException; import org.apache.tools.ant.taskdefs.Expand; import org.apache.tools.zip.ZipEntry; @@ -45,6 +46,7 @@ import java.util.List; import java.util.Map; import java.util.StringTokenizer; import java.util.Set; +import java.util.TreeSet; import java.util.HashSet; import java.util.HashMap; import java.util.regex.Matcher; @@ -272,10 +274,17 @@ public class CVSSCM extends AbstractCVSFamilySCM { parseUpdateOutput("",baos, changedFileNames); } else { - StringTokenizer tokens = new StringTokenizer(module); - while(tokens.hasMoreTokens()) { - String moduleName = tokens.nextToken(); - + Set moduleNames = new TreeSet(Collections.list(new StringTokenizer(module))); + // Add in any existing CVS dirs, in case project checked out its own. + File[] subdirs = workspace.getLocal().listFiles(); + if (subdirs != null) { + for (File s : subdirs) { + if (new File(s, "CVS").isDirectory()) { + moduleNames.add(s.getName()); + } + } + } + for (String moduleName : moduleNames) { // capture the output during update ByteArrayOutputStream baos = new ByteArrayOutputStream(); -- GitLab