Author: bodewig
Date: Thu Oct 16 07:39:24 2008
New Revision: 705256
URL: http://svn.apache.org/viewvc?rev=705256&view=rev
Log:
support modules with space in their names in <cvs> and <cvschangelog>, will be
supported in <cvstagdiff> once PR 35301 is fixed. PR 38220.
Added:
ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant module 2/
ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant module
2/test.txt,v
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/docs/manual/CoreTasks/changelog.html
ant/core/trunk/docs/manual/CoreTasks/cvs.html
ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
ant/core/trunk/src/tests/antunit/taskdefs/cvs/cvs.xml
ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history
Modified: ant/core/trunk/WHATSNEW
URL:
http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Oct 16 07:39:24 2008
@@ -456,6 +456,9 @@
* <cvstagdiff> has an option to ignore removed files now.
Bugzilla Report 26257.
+ * <cvs> and friends now support modules with spaces in their names
+ via nested <module> elements.
+
Changes from Ant 1.7.0 TO Ant 1.7.1
=============================================
Modified: ant/core/trunk/docs/manual/CoreTasks/changelog.html
URL:
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/changelog.html?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/changelog.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/changelog.html Thu Oct 16 07:39:24 2008
@@ -59,7 +59,10 @@
</tr>
<tr>
<td valign="top">package</td>
- <td valign="top">the package/module to check out.</td>
+ <td valign="top">the package/module to check out. <b>Note:</b>
+ multiple attributes can be split using spaces. Use a nested
+ <module> element if you want to specify a module with
+ spaces in its name.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
@@ -153,6 +156,24 @@
</tr>
</table>
+<h4>module</h4>
+
+<p>Specifies a package/module to work on, unlike the package attribute
+ modules specified using this attribute can contain spaces in their
+ name.</p>
+
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">The module's/package's name.</td>
+ <td align="center" valign="top">Yes.</td>
+ </tr>
+</table>
<h3>Examples</h3>
<pre> <cvschangelog dir="dve/network"
Modified: ant/core/trunk/docs/manual/CoreTasks/cvs.html
URL:
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/cvs.html?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/cvs.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/cvs.html Thu Oct 16 07:39:24 2008
@@ -90,7 +90,10 @@
</tr>
<tr>
<td valign="top">package</td>
- <td valign="top">the package/module to check out.</td>
+ <td valign="top">the package/module to check out. <b>Note:</b>
+ multiple attributes can be split using spaces. Use a nested
+ <module> element if you want to specify a module with
+ spaces in its name.</td>
<td align="center" valign="top">No</td>
</tr>
<tr>
@@ -151,6 +154,28 @@
<td align="center" valign="top">No</td>
</tr>
</table>
+
+<h3>Parameters specified as nested elements</h3>
+
+<h4>module</h4>
+
+<p>Specifies a package/module to work on, unlike the package attribute
+ modules specified using this attribute can contain spaces in their
+ name.</p>
+
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">The module's/package's name.</td>
+ <td align="center" valign="top">Yes.</td>
+ </tr>
+</table>
+
<h3>Examples</h3>
<pre> <cvs cvsRoot=":pserver:[EMAIL PROTECTED]:/home/cvspublic"
package="ant"
Modified: ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html
URL:
http://svn.apache.org/viewvc/ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html (original)
+++ ant/core/trunk/docs/manual/CoreTasks/cvstagdiff.html Thu Oct 16 07:39:24
2008
@@ -103,7 +103,11 @@
<td valign="top">the package/module to analyze.<br>
Since ant 1.6
multiple packages separated by spaces are possible.
- aliases corresponding to different modules are also possible</td>
+ aliases corresponding to different modules are also possible
+ Use a nested <module> element if you want to specify a module with
+ spaces in its name.</td>
+ <td align="center" valign="top">No</td>
+ </tr>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
@@ -130,6 +134,27 @@
</table>
<h3>Examples</h3>
+
+<h4>module</h4>
+
+<p>Specifies a package/module to work on, unlike the package attribute
+ modules specified using this attribute can contain spaces in their
+ name.</p>
+
+<table border="1" cellpadding="2" cellspacing="0">
+ <tr>
+ <td valign="top"><b>Attribute</b></td>
+ <td valign="top"><b>Description</b></td>
+ <td align="center" valign="top"><b>Required</b></td>
+ </tr>
+ <tr>
+ <td valign="top">name</td>
+ <td valign="top">The module's/package's name.</td>
+ <td align="center" valign="top">Yes.</td>
+ </tr>
+</table>
+
+<h3>Examples</h3>
<pre> <cvstagdiff cvsRoot=":pserver:[EMAIL
PROTECTED]:/home/cvspublic"
destfile="tagdiff.xml"
package="ant"
Modified:
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
(original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
Thu Oct 16 07:39:24 2008
@@ -24,6 +24,9 @@
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintStream;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
import java.util.Vector;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
@@ -52,6 +55,8 @@
private Commandline cmd = new Commandline();
+ private ArrayList modules = new ArrayList();
+
/** list of Commandline children */
private Vector vecCommandlines = new Vector();
@@ -763,6 +768,10 @@
if (cvsPackage != null) {
c.createArgument().setLine(cvsPackage);
}
+ for (Iterator iter = modules.iterator(); iter.hasNext(); ) {
+ Module m = (Module) iter.next();
+ c.createArgument().setValue(m.getName());
+ }
if (this.compression > 0
&& this.compression <= MAXIMUM_COMRESSION_LEVEL) {
c.createArgument(true).setValue("-z" + this.compression);
@@ -836,4 +845,27 @@
? AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0);
}
+ /**
+ * add a named module/package.
+ *
+ * @since Ant 1.8.0
+ */
+ public void addModule(Module m) {
+ modules.add(m);
+ }
+
+ protected List getModules() {
+ return (List) modules.clone();
+ }
+
+ public static final class Module {
+ private String name;
+ public void setName(String s) {
+ name = s;
+ }
+ public String getName() {
+ return name;
+ }
+ }
+
}
Modified: ant/core/trunk/src/tests/antunit/taskdefs/cvs/cvs.xml
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/cvs/cvs.xml?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/cvs/cvs.xml (original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/cvs/cvs.xml Thu Oct 16 07:39:24
2008
@@ -37,4 +37,15 @@
destfile="${output}/report.xml"/>
<au:assertFileExists file="${output}/report.xml"/>
</target>
+
+ <target name="testCvsWithSpaceInModule">
+ <mkdir dir="${output}"/>
+ <cvs cvsroot="${cvsroot}" dest="${output}">
+ <module name="ant module 2"/>
+ </cvs>
+ <au:assertFileExists file="${output}/ant module 2/test.txt"/>
+ <cvschangelog dir="${output}/ant module 2"
+ destfile="${output}/report.xml"/>
+ <au:assertFileExists file="${output}/report.xml"/>
+ </target>
</project>
Modified:
ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history?rev=705256&r1=705255&r2=705256&view=diff
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history
(original)
+++ ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history
Thu Oct 16 07:39:24 2008
@@ -8,3 +8,7 @@
O48f74a02|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
M48f74a39|stefan|/tmp/testoutput/*0|antmodule1|1.4|foo.txt
O48f74a62|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
+O48f75161|stefan|/tmp/testoutput/*0|ant module 2||ant module 2
+O48f75185|stefan|/tmp/testoutput/*0|ant module 2||ant module 2
+O48f75186|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
+O48f75196|stefan|/tmp/testoutput/*0|ant module 2||ant module 2
Added: ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant module
2/test.txt,v
URL:
http://svn.apache.org/viewvc/ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant%20module%202/test.txt%2Cv?rev=705256&view=auto
==============================================================================
--- ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant module
2/test.txt,v (added)
+++ ant/core/trunk/src/tests/antunit/taskdefs/cvs/repository/ant module
2/test.txt,v Thu Oct 16 07:39:24 2008
@@ -0,0 +1,41 @@
+head 1.1;
+branch 1.1.1;
+access ;
+symbols start:1.1.1.1 ant:1.1.1;
+locks ; strict;
+comment @# @;
+
+
+1.1
+date 2008.10.16.14.14.17; author stefan; state Exp;
+branches 1.1.1.1;
+next ;
+commitid cdf48f74c394567;
+
+1.1.1.1
+date 2008.10.16.14.14.17; author stefan; state Exp;
+branches ;
+next ;
+commitid cdf48f74c394567;
+
+
+desc
+@@
+
+
+
+1.1
+log
[EMAIL PROTECTED] revision
+@
+text
[EMAIL PROTECTED] a nice file.
+@
+
+
+1.1.1.1
+log
[EMAIL PROTECTED] with space in it's name
+@
+text
+@@