ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib CvsTagDiff.java
Date Wed, 04 Sep 2002 11:51:04 GMT
bodewig     2002/09/04 04:51:04

  Modified:    docs/manual/CoreTasks cvstagdiff.html
               src/main/org/apache/tools/ant/taskdefs/cvslib
                        CvsTagDiff.java
  Log:
  Make cvstagdiff inherit from AbstractCvsTask
  
  PR: 12119
  Submitted by:	Rob van Oostrum <rvanoo@xs4all.nl>
  
  Revision  Changes    Path
  1.3       +18 -0     jakarta-ant/docs/manual/CoreTasks/cvstagdiff.html
  
  Index: cvstagdiff.html
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/cvstagdiff.html,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- cvstagdiff.html	4 Sep 2002 11:05:16 -0000	1.2
  +++ cvstagdiff.html	4 Sep 2002 11:51:03 -0000	1.3
  @@ -42,6 +42,11 @@
       <td valign="top">The file in which to write the diff report.</td>
       <td align="center" valign="top">Yes</td>
     </tr>
  +  <tr>
  +    <td valign="top">rootdir</td>
  +    <td valign="top">Root directory for the package, if different from the package
name.</td>
  +    <td align="center" valign="top">No</td>
  +  </tr>
   </table>
   
   <h3>Parameters inherited from the <code>cvs</code> task</h3>
  @@ -118,6 +123,19 @@
   has not been set. The current <code>cvsRoot</code> will be used (assuming the
build is started
   from a folder stored in <code>cvs</code>.
   It writes these changes into the file <code>tagdiff.xml</code>.</p>
  +
  +<pre>  &lt;cvstagdiff
  +                destfile=&quot;tagdiff.xml&quot;
  +                package=&quot;jakarta-ant&quot;
  +                rootdir=&quot;jakarta/ant&quot;
  +                startDate=&quot;2002-01-01&quot;
  +                endDate=&quot;2002-31-01&quot;
  +  /&gt;</pre>
  +
  +<p>Generates a tagdiff report for all the changes that have been made
  +in the <code>jakarta-ant</code> module in january 2002, with <code>rootdir</code>
indicating that 
  +the actual location of the <code>jakarta-ant</code> module in cvs is <code>jakarta/ant</code>

  +rather than <code>jakarta-ant</code>.
   
   <h4>Generate Report</h4>
   <p>Ant includes a basic XSLT stylesheet that you can use to generate 
  
  
  
  1.10      +6 -85     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
  
  Index: CvsTagDiff.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- CvsTagDiff.java	25 Jul 2002 15:21:10 -0000	1.9
  +++ CvsTagDiff.java	4 Sep 2002 11:51:03 -0000	1.10
  @@ -64,8 +64,7 @@
   import java.util.Vector;
   import org.apache.tools.ant.BuildException;
   import org.apache.tools.ant.Project;
  -import org.apache.tools.ant.Task;
  -import org.apache.tools.ant.taskdefs.Cvs;
  +import org.apache.tools.ant.taskdefs.AbstractCvsTask;
   import org.apache.tools.ant.util.FileUtils;
   
   /**
  @@ -100,9 +99,8 @@
    * @version $Revision$ $Date$
    * @since Ant 1.5
    * @ant.task name="cvstagdiff"
  - * @todo Why doesn't this task extend from AbstractCvsTask?
    */
  -public class CvsTagDiff extends Task {
  +public class CvsTagDiff extends AbstractCvsTask {
   
       /**
        * Token to identify a new file in the rdiff log
  @@ -120,11 +118,6 @@
       static final String FILE_WAS_REMOVED = " is removed";
   
       /**
  -     * The cvs task which will perform the rdiff.
  -     */
  -    private Cvs m_cvs;
  -
  -    /**
        * The cvs package/module to analyse
        */
       private String m_package;
  @@ -160,48 +153,6 @@
       private FileUtils m_fileUtils = FileUtils.newFileUtils();
   
       /**
  -     * Initialize this task.
  -     * CvsTagDiff initializes a member cvs task in init() to perform the
  -     * rdiff in execute().
  -     *
  -     * @exception BuildException if an error occurs
  -     */
  -    public void init() throws BuildException {
  -        m_cvs = (Cvs) getProject().createTask("cvs");
  -    }
  -
  -    /**
  -     * If set to a value 1-9 it adds -zN to the cvs command line, else
  -     * it disables compression.
  -     *
  -     * @see org.apache.tools.ant.taskdefs.AbstractCvsTask#setCompressionLevel(int)
  -     */
  -    public void setCompressionLevel(int level) {
  -        m_cvs.setCompressionLevel(level);
  -    }
  -
  -    /**
  -     * If true, this is the same as compressionlevel="3".
  -     */
  -    public void setCompression(boolean usecomp) {
  -        m_cvs.setCompression(usecomp);
  -    }
  -
  -    /**
  -     * The CVSROOT variable.
  -     */
  -    public void setCvsRoot(String cvsRoot) {
  -        m_cvs.setCvsRoot(cvsRoot);
  -    }
  -
  -    /**
  -     * The CVS_RSH variable.
  -     */
  -    public void setCvsRsh(String rsh) {
  -        m_cvs.setCvsRsh(rsh);
  -    }
  -
  -    /**
        * The package/module to analyze.
        */
       public void setPackage(String p) {
  @@ -209,36 +160,6 @@
       }
   
       /**
  -     * If true, suppress informational messages.
  -     */
  -    public void setQuiet(boolean quiet) {
  -        m_cvs.setQuiet(quiet);
  -    }
  -
  -    /**
  -     * Port used by CVS to communicate with the server.
  -     */
  -    public void setPort(int port) {
  -        m_cvs.setPort(port);
  -    }
  -
  -    /**
  -     * Password file to read passwords from.
  -     */
  -    public void setPassfile(File f) {
  -        m_cvs.setPassfile(f);
  -    }
  -
  -    /**
  -     * Stop the build process if the command exits with
  -     * a return code other than 0.
  -     * Defaults to false.
  -     */
  -    public void setFailOnError(boolean b) {
  -        m_cvs.setFailOnError(b);
  -    }
  -
  -    /**
        * Set the start tag.
        *
        * @param s the start tag.
  @@ -299,15 +220,15 @@
               + (m_endTag != null ? ("-r " + m_endTag) : ("-D " + m_endDate))
               + " " + m_package;
           log("Cvs command is " + rdiff, Project.MSG_VERBOSE);
  -        m_cvs.setCommand(rdiff);
  +        setCommand(rdiff);
   
           File tmpFile = null;
           try {
               tmpFile = m_fileUtils.createTempFile("cvstagdiff", ".log", null);
  -            m_cvs.setOutput(tmpFile);
  +            setOutput(tmpFile);
   
               // run the cvs command
  -            m_cvs.execute();
  +            super.execute();
   
               // parse the rdiff
               CvsTagEntry[] entries = parseRDiff(tmpFile);
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message