CvsExportDiff

Description

Exports from CVS all the files changed within a tag or date range. This is useful in producing delta or patch releases of a project managed by CVS. You can combine this with the Tar or Zip tasks - an example is shown below.

This tasks uses the CvsTagDiff task to generate the list of files that should be exported and the Cvs task to checkout the particular version of the files and makes a clean copy (with no CVS directories) in a destination directory.

Parameters

Attribute Description Required
cvsRoot the CVSROOT variable. No
cvsRsh the CVS_RSH variable. No
dest the directory where the exported files should be placed. Yes
workingDirectory A temporary directory that will be used for the checkout Yes
package the package/module to export. No
startTag The earliest tag from which files are to be included in the export. exactly one of the two.
startDate The earliest date from which files are to be included in the export.
endTag The latest tag from which files are to be included in the export. exactly one of the two.
endDate The latest date from which files are to be included in the export.
compression true or false - if set to true, this is the same as compressionlevel="3" No. Defaults to false.
compressionlevel A number between 1 and 9 (corresponding to possible values for CVS' -z# argument). Any other value is treated as compression="false" No. Defaults to no compression.
port Port used by CVS to communicate with the server. No, default port 2401.
quiet Suppress informational messages. No, default "false"
passfile Password file to read passwords from. No, default file ~/.cvspass.
failonerror Stop the build process if the command exits with a return code other than 0. Defaults to false No

Examples

  <cvsexportdiff cvsRoot=":pserver:anoncvs@cvs.apache.org:/home/cvspublic"
                package="jakarta-ant"
                startTag="ANT_14"
                endTag="ANT_141"
                dest="/my/buildarea"
                workingDirectory="/tmp/checkoutarea"
  />

Determines all files that have been changed in the jakarta-ant module between the tags ANT_14 and ANT_141. The version of the files tagged with ANT_141 are exported to the directory /my/buildarea.

  <cvsexportdiff
                package="jakarta-ant"
                startDate="2002-01-01"
                endDate="2002-31-01"
                dest="/my/buildarea"
                workingDirectory="/tmp/checkoutarea"
  />

Determines all files that have been changed in the jakarta-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. The latest January version of each of the identified files are exported to the directory /my/buildarea.

<project name="zammo" default="tar-delta" basedir=".">
    <property name="tar-filename" value="build_20020915_01.tar" />
    <property name="startTag" value="Release2002Sep13" />
    <property name="endTag" value="HEAD" />

    <property name="tars" value="../tars" />
    <property name="temp" value="../tmp" />
    <property name="tarbuild" value="../tarbuild" />

    <target name="tar-delta">
        <delete dir="${tarbuild}" quiet="true" />
        <cvsexportdiff cvsRoot=":pserver:anoncvs@mycvsserver.org:/zammo"
            package="phase2/htdocs"
            startTag="${startTag}"
            endTag="${endTag}"
            dest="${tarbuild}"
            workingDirectory="${temp}"
            failOnError="true"
        />
        <mkdir dir="${tars}" />
        <tar
            tarfile="${tars}/${tar-filename}"
            basedir="${tarbuild}/phase2"
            longfile="warn"
        >
            <patternset>
                <exclude name="**/cgi-bin/**" />
                <exclude name="**/!*" />
                <exclude name="**/pspbrwse.jbf" />
                <exclude name="**/Thumbs.db" />
            </patternset>
        </tar>
    </target>
</project>

For the zammo project export all the changed files since tag Release2002Sep13 (the HEAD means latest) to a directory symbolically idenitified by the tarbuild property. Note that the tarbuild directory is cleared first to ensure previous exports are not present there (you may or may not want this behaviour). Then run the tar task on these exported files, omitting certain files; specifying a slightly different basedir in order to get a the tar file to contain the right amount of 'path' for the the process that will use this tar.


Copyright © 2002 Apache Software Foundation. All rights Reserved.