git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705256 13f79535-47bb-0310-9956-ffa450edef68master
@@ -456,6 +456,9 @@ Other changes: | |||||
* <cvstagdiff> has an option to ignore removed files now. | * <cvstagdiff> has an option to ignore removed files now. | ||||
Bugzilla Report 26257. | 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 | Changes from Ant 1.7.0 TO Ant 1.7.1 | ||||
============================================= | ============================================= | ||||
@@ -59,7 +59,10 @@ operation may fail when using such an incompatible client. | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">package</td> | <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> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -153,6 +156,24 @@ the name specified in <code>displayname</code> rather than the user ID. | |||||
</tr> | </tr> | ||||
</table> | </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> | <h3>Examples</h3> | ||||
<pre> <cvschangelog dir="dve/network" | <pre> <cvschangelog dir="dve/network" | ||||
@@ -90,7 +90,10 @@ report 21657</a> for recommended workarounds.</p> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">package</td> | <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> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -151,6 +154,28 @@ report 21657</a> for recommended workarounds.</p> | |||||
<td align="center" valign="top">No</td> | <td align="center" valign="top">No</td> | ||||
</tr> | </tr> | ||||
</table> | </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> | <h3>Examples</h3> | ||||
<pre> <cvs cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | <pre> <cvs cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | ||||
package="ant" | package="ant" | ||||
@@ -103,7 +103,11 @@ operation may fail when using such an incompatible client. | |||||
<td valign="top">the package/module to analyze.<br> | <td valign="top">the package/module to analyze.<br> | ||||
Since ant 1.6 | Since ant 1.6 | ||||
multiple packages separated by spaces are possible. | 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> | <td align="center" valign="top">Yes</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -129,6 +133,27 @@ operation may fail when using such an incompatible client. | |||||
</tr> | </tr> | ||||
</table> | </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> | <h3>Examples</h3> | ||||
<pre> <cvstagdiff cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | <pre> <cvstagdiff cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" | ||||
destfile="tagdiff.xml" | destfile="tagdiff.xml" | ||||
@@ -24,6 +24,9 @@ import java.io.FileOutputStream; | |||||
import java.io.IOException; | import java.io.IOException; | ||||
import java.io.OutputStream; | import java.io.OutputStream; | ||||
import java.io.PrintStream; | import java.io.PrintStream; | ||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import java.util.List; | |||||
import java.util.Vector; | import java.util.Vector; | ||||
import org.apache.tools.ant.BuildException; | import org.apache.tools.ant.BuildException; | ||||
import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
@@ -52,6 +55,8 @@ public abstract class AbstractCvsTask extends Task { | |||||
private Commandline cmd = new Commandline(); | private Commandline cmd = new Commandline(); | ||||
private ArrayList modules = new ArrayList(); | |||||
/** list of Commandline children */ | /** list of Commandline children */ | ||||
private Vector vecCommandlines = new Vector(); | private Vector vecCommandlines = new Vector(); | ||||
@@ -763,6 +768,10 @@ public abstract class AbstractCvsTask extends Task { | |||||
if (cvsPackage != null) { | if (cvsPackage != null) { | ||||
c.createArgument().setLine(cvsPackage); | 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 | if (this.compression > 0 | ||||
&& this.compression <= MAXIMUM_COMRESSION_LEVEL) { | && this.compression <= MAXIMUM_COMRESSION_LEVEL) { | ||||
c.createArgument(true).setValue("-z" + this.compression); | c.createArgument(true).setValue("-z" + this.compression); | ||||
@@ -836,4 +845,27 @@ public abstract class AbstractCvsTask extends Task { | |||||
? AbstractCvsTask.DEFAULT_COMPRESSION_LEVEL : 0); | ? 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; | |||||
} | |||||
} | |||||
} | } |
@@ -37,4 +37,15 @@ | |||||
destfile="${output}/report.xml"/> | destfile="${output}/report.xml"/> | ||||
<au:assertFileExists file="${output}/report.xml"/> | <au:assertFileExists file="${output}/report.xml"/> | ||||
</target> | </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> | </project> |
@@ -8,3 +8,7 @@ O48f749a9|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | |||||
O48f74a02|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | O48f74a02|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | ||||
M48f74a39|stefan|/tmp/testoutput/*0|antmodule1|1.4|foo.txt | M48f74a39|stefan|/tmp/testoutput/*0|antmodule1|1.4|foo.txt | ||||
O48f74a62|stefan|/tmp/testoutput/*0|antmodule1||antmodule1 | 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 |
@@ -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 | |||||
@Initial revision | |||||
@ | |||||
text | |||||
@What a nice file. | |||||
@ | |||||
1.1.1.1 | |||||
log | |||||
@module with space in it's name | |||||
@ | |||||
text | |||||
@@ |