Browse Source

support modules with space in their names in <cvs> and <cvschangelog>, will be supported in <cvstagdiff> once PR 35301 is fixed. PR 38220.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705256 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 16 years ago
parent
commit
d85c862e9e
8 changed files with 165 additions and 3 deletions
  1. +3
    -0
      WHATSNEW
  2. +22
    -1
      docs/manual/CoreTasks/changelog.html
  3. +26
    -1
      docs/manual/CoreTasks/cvs.html
  4. +26
    -1
      docs/manual/CoreTasks/cvstagdiff.html
  5. +32
    -0
      src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java
  6. +11
    -0
      src/tests/antunit/taskdefs/cvs/cvs.xml
  7. +4
    -0
      src/tests/antunit/taskdefs/cvs/repository/CVSROOT/history
  8. +41
    -0
      src/tests/antunit/taskdefs/cvs/repository/ant module 2/test.txt,v

+ 3
- 0
WHATSNEW View File

@@ -456,6 +456,9 @@ Other changes:
* <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
=============================================



+ 22
- 1
docs/manual/CoreTasks/changelog.html View File

@@ -59,7 +59,10 @@ operation may fail when using such an incompatible client.
</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
&lt;module&gt; 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 @@ the name specified in <code>displayname</code> rather than the user ID.
</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> &lt;cvschangelog dir=&quot;dve/network&quot;


+ 26
- 1
docs/manual/CoreTasks/cvs.html View File

@@ -90,7 +90,10 @@ report 21657</a> for recommended workarounds.</p>
</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
&lt;module&gt; 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 @@ report 21657</a> for recommended workarounds.</p>
<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> &lt;cvs cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
package=&quot;ant&quot;


+ 26
- 1
docs/manual/CoreTasks/cvstagdiff.html View File

@@ -103,7 +103,11 @@ operation may fail when using such an incompatible client.
<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 &lt;module&gt; 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>
@@ -129,6 +133,27 @@ operation may fail when using such an incompatible client.
</tr>
</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> &lt;cvstagdiff cvsRoot=&quot;:pserver:anoncvs@cvs.apache.org:/home/cvspublic&quot;
destfile=&quot;tagdiff.xml&quot;


+ 32
- 0
src/main/org/apache/tools/ant/taskdefs/AbstractCvsTask.java View File

@@ -24,6 +24,9 @@ import java.io.FileOutputStream;
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 @@ public abstract class AbstractCvsTask extends Task {

private Commandline cmd = new Commandline();

private ArrayList modules = new ArrayList();

/** list of Commandline children */
private Vector vecCommandlines = new Vector();

@@ -763,6 +768,10 @@ public abstract class AbstractCvsTask extends Task {
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 @@ public abstract class AbstractCvsTask extends Task {
? 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;
}
}

}

+ 11
- 0
src/tests/antunit/taskdefs/cvs/cvs.xml View File

@@ -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>

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

@@ -8,3 +8,7 @@ O48f749a9|stefan|/tmp/testoutput/*0|antmodule1||antmodule1
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

+ 41
- 0
src/tests/antunit/taskdefs/cvs/repository/ant module 2/test.txt,v View File

@@ -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
@@

Loading…
Cancel
Save