RevisionDiff

Description

Generates an XML-formatted report file of the changes between two revisions recorded in a Subversion repository.

Important: This task needs "svn" on the path. If it isn't, you will get an error (such as error 2 on windows). If <svn> doesn't work, try to execute svn.exe from the command line in the target directory in which you are working.

Parameters

Attribute Description Required
start The earliest revision from which diffs are to be included in the report. Yes.
end The latest revision from which diffs are to be included in the report. Yes.
destfile The file in which to write the diff report. Yes

Parameters inherited from the svn task

Attribute Description Required
svnURL the svn URL to diff. No
failonerror Stop the buildprocess if the command exits with a returncode other than 0. Defaults to false No

Examples

  <revisiondiff
                svnURL="http://svn.apache.org/repos/asf/jakarta/bcel/trunk"
                destfile="diff.xml"
                start="152904"
                end="153682"
  />

Generates a revisiondiff report for all the changes that have been made in the Apache BCEL module between the revisions 152904 and 153682. It writes these changes into the file diff.xml.

  <revisiondiff
                destfile="diff.xml"
                package="ant"
                start="{2002-01-01}"
                end="{2002-02-01}"
                dest="my-working-copy-of-BCEL"
  />

Generates a diff report for all the changes that have been made in the Apache BCEL module in january 2002. In this example svnURL has not been set, it is assumed that my-working-copy-of-BCEL contains a checked out copy of the BCEL module. It writes these changes into the file diff.xml.

Generate Report

This antlib 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="diff.xml" 
               out="diff.html" 
               style="your-path-to/etc/diff.xsl">
          <param name="title" expression="Jakarta BCEL diff"/>
          <param name="repo" expression="http://svn.apache.org/repos/asf/jakarta/bcel/trunk"/>
        </style>

(Shortened) Example Output

<?xml version="1.0" encoding="UTF-8"?>
<revisiondiff start="153872" end="152873" svnurl="http://svn.apache.org/repos/asf/jakarta/bcel/trunk" >
  <path>
    <name><![CDATA[LICENSE.txt]]></name>
    <action>modified</action>
  </path>
  <path>
    <name><![CDATA[NOTICE.txt]]></name>
    <action>deleted</action>
  </path>
</revisiondiff>