## CvsTagDiff

### Description

Generates an XML-formatted report file of the changes between two tags or dates recorded in a CVS repository.

Important: This task needs `cvs` on the path. If it isn't, you will get an error (such as `error=2` on Windows). If `<cvs>` doesn't work, try to execute `cvs.exe` from the command line in the target directory in which you are working. Also note that this task assumes that the `cvs` executable is compatible with the Unix version, this is not completely true for certain other CVS clients—like CVSNT for example—and some operation may fail when using such an incompatible client.

### Parameters

Attribute | Description | Required
--- | --- | ---
startTag | The earliest tag from which diffs are to be included in the report. | Exactly one of the two
startDate | The earliest date from which diffs are to be included in the report. Accepts all formats accepted by the `cvs` command for `-D date_spec` arguments.
endTag | The latest tag from which diffs are to be included in the report. | Exactly one of the two
endDate | The latest date from which diffs are to be included in the report. Accepts all formats accepted by the `cvs` command for `-D date_spec` arguments.
destfile | The file in which to write the diff report. | Yes
ignoreRemoved | When set to true, the report will not include any removed files. Since Apache Ant 1.8.0 | No; defaults to false

### Parameters inherited from the `cvs` task

Attribute | Description | Required
--- | --- | ---
compression | true (equivalent to 3), false, or a number between 1 and 9 (corresponding to possible values for CVS `-z#` argument). Any other value is treated as false | No; defaults to no compression
cvsRoot | the `CVSROOT` variable. | No
cvsRsh | the `CVS_RSH` variable. | No
package | the package/module to analyze. Since Ant 1.6 multiple packages separated by spaces are possible. aliases corresponding to different modules are also possible. Use a nested `<module>` element if you want to specify a module with spaces in its name. | No
quiet | suppress informational messages. | No; default false
port | Port used by CVS to communicate with the server. | No; default 2401
passfile | Password file to read passwords from. | No; default ~/.cvspass
failonerror | Stop the build process if the command exits with a return code other than 0. | No; defaults to false

### Parameters specified as nested elements

#### module

Specifies a package/module to work on, unlike the package attribute modules specified using this attribute can contain spaces in their name.

Attribute | Description | Required
--- | --- | ---
name | Name of the module/package. | Yes

### Examples

    <cvstagdiff cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
                destfile="tagdiff.xml"
                package="ant"
                startTag="ANT_14"
                endTag="ANT_141"/>

Generates a `tagdiff` report for all the changes that have been made in the `ant` module between the tags `ANT_14` and `ANT_141`. It writes these changes into the file `tagdiff.xml`.

    <cvstagdiff destfile="tagdiff.xml"
                package="ant"
                startDate="2002-01-01"
                endDate="2002-31-01"/>

Generates a `tagdiff` report for all the changes that have been made in the `ant` module in January 2002. In this example cvsRoot has not been set. The current cvsRoot will be used (assuming the build is started from a folder stored in `cvs`. It writes these changes into the file `tagdiff.xml`.

    <cvstagdiff destfile="tagdiff.xml"
                package="ant jakarta-gump"
                startDate="2003-01-01"
                endDate="2003-31-01"/>

Generates a `tagdiff` report for all the changes that have been made in the `ant` and `jakarta-gump` modules in January 2003. In this example cvsRoot has not been set. The current cvsRoot will be used (assuming the build is started from a folder stored in `cvs`. It writes these changes into the file `tagdiff.xml`.

#### Generate Report

Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml output. The following example illustrates how to generate a HTML report from the XML report.

    <style in="tagdiff.xml"
           out="tagdiff.html"
           style="${ant.home}/etc/tagdiff.xsl">
      <param name="title" expression="Ant Diff"/>
      <param name="module" expression="ant"/>
      <param name="cvsweb" expression="http://cvs.apache.org/viewcvs/"/>
    </style>

#### Output

The cvsroot and package attributes of the `tagdiff` element are new in Ant 1.6.
Notes on `entry` attributes:

Attribute | Comment
--- | ---
name | when reporting on one package, the package name is removed from the output
revision | supplied for files which exist at the end of the reporting period
prevrevision | supplied for files which exist at the beginning of the reporting period. Old CVS servers do not supply it for deleted files. CVS 1.12.2 supplies it.

    <?xml version="1.0" encoding="UTF-8"?>
    <tagdiff startTag="ANT_14" endTag="ANT_141"
             cvsroot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic" package="ant">
      <entry>
        <file>
          <name>src/main/org/apache/tools/ant/DirectoryScanner.java</name>
          <revision>1.15.2.1</revision>
          <prevrevision>1.15</prevrevision>
        </file>
      </entry>
    </tagdiff>