Sorry, I've edited too much I'm afraid. 

The last version didn't work when no CVSROOT was specified. The
complete - now corrected - patch is appended again.

Stefan

Index: docs/index.html
===================================================================
RCS file: /home/cvspublic/jakarta-ant/docs/index.html,v
retrieving revision 1.21
diff -u -r1.21 index.html
--- docs/index.html	2000/06/01 06:54:52	1.21
+++ docs/index.html	2000/06/02 15:14:32
@@ -713,10 +723,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>
@@ -725,9 +735,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 &quot;checkout&quot;</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>
@@ -737,13 +752,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 &quot;false&quot;</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 &quot;false&quot;</td>
+  </tr>
 </table>
 <h3>Examples</h3>
 <pre>  &lt;cvs cvsRoot=&quot;:pserver:[EMAIL PROTECTED]:/home/cvspublic&quot;
@@ -752,6 +777,9 @@
   /&gt;</pre>
 <p>checks out the package/module &quot;jakarta-tools&quot; from the CVS
 repository pointed to by the cvsRoot attribute, and stores the files in &quot;${ws.dir}&quot;.</p>
+<pre>  &lt;cvs dest=&quot;${ws.dir}&quot; command=&quot;update&quot; /&gt;</pre>
+<p>updates the package/module that has previously been checked out into
+&quot;${ws.dir}&quot;.</p>
 <hr>
 <h2><a name="delete">Delete</a></h2>
 <h3>Description</h3>
Index: src/main/org/apache/tools/ant/taskdefs/Cvs.java
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Cvs.java,v
retrieving revision 1.4
diff -u -r1.4 Cvs.java
--- src/main/org/apache/tools/ant/taskdefs/Cvs.java	2000/05/24 06:45:05	1.4
+++ src/main/org/apache/tools/ant/taskdefs/Cvs.java	2000/06/02 15:14:33
@@ -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);
+    }
 }
 
 

Reply via email to