sbailliez    01/12/29 11:46:45

  Modified:    docs/manual/CoreTasks cvs.html
               src/main/org/apache/tools/ant/taskdefs Cvs.java
  Log:
  Add an option to append output, I set it to false
  to preserve behavior but I think it would be better
  to true.
  PR: 5559
  Reported by: [EMAIL PROTECTED] (Stefan Freyr Stefansson)
  
  Revision  Changes    Path
  1.7       +10 -5     jakarta-ant/docs/manual/CoreTasks/cvs.html
  
  Index: cvs.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/cvs.html,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- cvs.html  19 Nov 2001 10:54:50 -0000      1.6
  +++ cvs.html  29 Dec 2001 19:46:45 -0000      1.7
  @@ -9,7 +9,7 @@
   
   <h2><a name="cvs">Cvs</a></h2>
   <h3>Description</h3>
  -<p>Handles packages/modules retrieved from a 
  +<p>Handles packages/modules retrieved from a
   <a href="http://www.cvshome.org/"; target="_top">CVS</a> repository.</p>
   <p>When doing automated builds, the <a href="get.html">get task</a> should be
   preferred over the <i>checkout</i> command, because of speed.</p>
  @@ -63,7 +63,7 @@
     <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>
  +    <td align="center" valign="top">No, default to &quot;false&quot;</td>
     </tr>
     <tr>
       <td valign="top">output</td>
  @@ -76,6 +76,11 @@
       <td align="center" valign="top">No, default error to ANT Log as 
MSG_WARN.</td>
     </tr>
     <tr>
  +    <td valign="top">append</td>
  +    <td valign="top">whether to append output/error when redirecting to a 
file.</td>
  +    <td align="center" valign="top">No, default to &quot;false&quot;.</td>
  +  </tr>
  +  <tr>
       <td valign="top">port</td>
       <td valign="top">Port used by CVS to communicate with the server.</td>
       <td align="center" valign="top">No, default port 2401.</td>
  @@ -106,9 +111,9 @@
   <p>silently (-q) creates a file called patch.txt which contains a unified 
(-u) diff which includes new files added via &quot;cvs add&quot; (-N) and can 
be used as input to patch.</p>
   <pre>  &lt;cvs command=&quot;update -A -d&quot;/&gt;</pre>
   <p>Updates from the head of repository ignoring sticky bits (-A) and 
creating any new directories as necessary (-d).</p>
  -<p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any 
cvs options should appear 
  -before the command, and any command options should appear after the command 
as in the diff example 
  -above. See <a href="http://www.cvshome.org/docs/manual/index.html"; 
target="_top">the cvs manual</a> for details, 
  +<p>Note: the text of the command is passed to cvs &quot;as-is&quot; so any 
cvs options should appear
  +before the command, and any command options should appear after the command 
as in the diff example
  +above. See <a href="http://www.cvshome.org/docs/manual/index.html"; 
target="_top">the cvs manual</a> for details,
   specifically the <a href="http://www.cvshome.org/docs/manual/cvs_16.html"; 
target="_top">Guide to CVS commands</a></p>
   <hr><p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. 
All rights
   Reserved.</p>
  
  
  
  1.18      +9 -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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Cvs.java  19 Nov 2001 10:54:50 -0000      1.17
  +++ Cvs.java  29 Dec 2001 19:46:45 -0000      1.18
  @@ -123,6 +123,9 @@
        */
       private File dest;
   
  +    /** whether or not to append stdout/stderr to existing files */
  +    private boolean append = false;
  +
       /**
        * the file to direct standard output from the command.
        */
  @@ -201,7 +204,7 @@
           else {
               if (output != null) {
                   try {
  -                    outputstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(output)));
  +                    outputstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(output.getPath(), append)));
                   } catch (IOException e) {
                       throw new BuildException(e, location);
                   }
  @@ -211,7 +214,7 @@
               }
               if (error != null) {
                   try {
  -                    errorstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(error)));
  +                    errorstream = new PrintStream(new 
BufferedOutputStream(new FileOutputStream(error.getPath(), append)));
                   } catch (IOException e) {
                       throw new BuildException(e, location);
                   }
  @@ -322,6 +325,10 @@
   
       public void setError(File error) {
           this.error = error;
  +    }
  +
  +    public void setAppend(boolean value){
  +        this.append = value;
       }
   
       public void setFailOnError(boolean failOnError) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to