conor 00/06/17 08:38:42
Modified: docs index.html
src/main/org/apache/tools/ant/taskdefs Cvs.java
Log:
Extend CVS Task functionality.
This patch adds quiet and noexec attributes (for the -q and -n
switches) and a command attribute that specifies which CVS command to
execute.
The default command is "checkout" to remain compatible to the existing
behaviour.
Wolfgang Werner [EMAIL PROTECTED]
update by Stefan Bodewig [EMAIL PROTECTED]
Revision Changes Path
1.23 +23 -5 jakarta-ant/docs/index.html
Index: index.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/index.html,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- index.html 2000/06/16 01:46:12 1.22
+++ index.html 2000/06/17 15:38:41 1.23
@@ -726,10 +726,10 @@
<hr>
<h2><a name="cvs">Cvs</a></h2>
<h3>Description</h3>
-<p>Checks out a package/module from a <a
href="http://www.cyclic.com/">CVS</a>
-repository.</p>
+<p>Handles packages/modules retrieved from a
+<a href="http://www.cyclic.com/">CVS</a> repository.</p>
<p>When doing automated builds, the <a href="#get">get task</a> should be
-preferred, because of speed.</p>
+preferred over the <i>checkout</i> command, because of speed.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -738,9 +738,14 @@
<td align="center" valign="top"><b>Required</b></td>
</tr>
<tr>
+ <td valign="top">command</td>
+ <td valign="top">the CVS command to execute.</td>
+ <td align="center" valign="top">No, default "checkout"</td>
+ </tr>
+ <tr>
<td valign="top">cvsRoot</td>
<td valign="top">the CVSROOT variable.</td>
- <td align="center" valign="top">Yes</td>
+ <td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">dest</td>
@@ -750,13 +755,23 @@
<tr>
<td valign="top">package</td>
<td valign="top">the package/module to check out.</td>
- <td align="center" valign="top">Yes</td>
+ <td align="center" valign="top">No</td>
</tr>
<tr>
<td valign="top">tag</td>
<td valign="top">the tag of the package/module to check out.</td>
<td align="center" valign="top">No</td>
</tr>
+ <tr>
+ <td valign="top">quiet</td>
+ <td valign="top">supress informational messages.</td>
+ <td align="center" valign="top">No, default "false"</td>
+ </tr>
+ <tr>
+ <td valign="top">noexec</td>
+ <td valign="top">report only, don't change any files.</td>
+ <td align="center" valign="top">No, default "false"</td>
+ </tr>
</table>
<h3>Examples</h3>
<pre> <cvs cvsRoot=":pserver:[EMAIL PROTECTED]:/home/cvspublic"
@@ -765,6 +780,9 @@
/></pre>
<p>checks out the package/module "jakarta-tools" from the CVS
repository pointed to by the cvsRoot attribute, and stores the files in
"${ws.dir}".</p>
+<pre> <cvs dest="${ws.dir}" command="update"
/></pre>
+<p>updates the package/module that has previously been checked out into
+"${ws.dir}".</p>
<hr>
<td valign="top">comma separated list of filenam<h2><a
name="delete">Delete</a></h2>
<h3>Description</h3>
1.5 +32 -2
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java
Index: Cvs.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Cvs.java 2000/05/24 06:45:05 1.4
+++ Cvs.java 2000/06/17 15:38:42 1.5
@@ -69,6 +69,9 @@
private String cvsRoot;
private String pack;
private String tag;
+ private String command = "checkout";
+ private boolean quiet = false;
+ private boolean noexec = false;
public void execute() throws BuildException {
@@ -76,16 +79,32 @@
// execution so that we don't rely on having native CVS stuff around
(SM)
StringBuffer sb=new StringBuffer();
- sb.append(" cvs -d ").append( cvsRoot ).append(" checkout ");
+ sb.append(" cvs ");
+ if (cvsRoot != null) {
+ sb.append("-d ").append(cvsRoot).append(" ");
+ }
+
+ sb.append(noexec ? "-n " : "")
+ .append(quiet ? "-q " : "")
+ .append(command).append(" ");
+
if (tag!=null)
sb.append("-r ").append(tag).append(" ");
- sb.append( pack );
+ if (pack != null) {
+ sb.append(pack);
+ }
run(sb.toString());
}
public void setCvsRoot(String root) {
+ // Check if not real cvsroot => set it to null
+ if (root != null) {
+ if (root.trim().equals(""))
+ root = null;
+ }
+
this.cvsRoot = root;
}
@@ -107,6 +126,17 @@
this.tag = p;
}
+ public void setCommand(String c) {
+ this.command = c;
+ }
+
+ public void setQuiet(String q) {
+ quiet = Project.toBoolean(q);
+ }
+
+ public void setNoexec(String ne) {
+ noexec = Project.toBoolean(ne);
+ }
}