Browse Source

properly deal wih multiple modules specified in the package attribute

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@706207 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
8ead313e92
2 changed files with 19 additions and 7 deletions
  1. +15
    -7
      src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java
  2. +4
    -0
      src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history

+ 15
- 7
src/main/org/apache/tools/ant/taskdefs/cvslib/ChangeLogParser.java View File

@@ -20,11 +20,13 @@ package org.apache.tools.ant.taskdefs.cvslib;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.Locale;
import java.util.StringTokenizer;
import java.util.TimeZone;
import org.apache.tools.ant.taskdefs.AbstractCvsTask;
import org.apache.tools.ant.util.CollectionUtils;
@@ -81,16 +83,22 @@ class ChangeLogParser {

public ChangeLogParser(boolean remote, String packageName, List modules) {
this.remote = remote;
moduleNames = new String[modules.size() + (packageName == null ? 0 : 1)];
moduleNameLengths = new int[moduleNames.length];
int i = 0;

ArrayList names = new ArrayList();
if (packageName != null) {
moduleNames[i] = packageName;
moduleNameLengths[i++] = packageName.length();
for (StringTokenizer tok = new StringTokenizer(packageName);
tok.hasMoreTokens(); ) {
names.add(tok.nextToken());
}
}
for (Iterator iter = modules.iterator(); iter.hasNext(); i++) {
for (Iterator iter = modules.iterator(); iter.hasNext(); ) {
AbstractCvsTask.Module m = (AbstractCvsTask.Module) iter.next();
moduleNames[i] = m.getName();
names.add(m.getName());
}

moduleNames = (String[]) names.toArray(new String[names.size()]);
moduleNameLengths = new int[moduleNames.length];
for (int i = 0; i < moduleNames.length; i++) {
moduleNameLengths[i] = moduleNames[i].length();
}
}


+ 4
- 0
src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history View File

@@ -52,3 +52,7 @@ O48f8b328|stefan|/tmp/testoutput/*0|antmodule3||antmodule3
O48f8b329|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
O48f8b32b|stefan|/tmp/testoutput/*0|ant module 2||ant module 2
O48f8b32c|stefan|/tmp/testoutput/*0|antmodule3||antmodule3
O48fc5e01|stefan|/tmp/testoutput/*0|antmodule3||antmodule3
O48fc5e03|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
O48fc5e05|stefan|/tmp/testoutput/*0|ant module 2||ant module 2
O48fc5e06|stefan|/tmp/testoutput/*0|antmodule3||antmodule3

Loading…
Cancel
Save