diff --git a/docs/manual/CoreTasks/cvstagdiff.html b/docs/manual/CoreTasks/cvstagdiff.html index be4858ab3..4c1b43072 100644 --- a/docs/manual/CoreTasks/cvstagdiff.html +++ b/docs/manual/CoreTasks/cvstagdiff.html @@ -42,6 +42,11 @@
cvs
taskcvsRoot
will be used (assuming the bu
from a folder stored in cvs
.
It writes these changes into the file tagdiff.xml
.
+<cvstagdiff + destfile="tagdiff.xml" + package="jakarta-ant" + rootdir="jakarta/ant" + startDate="2002-01-01" + endDate="2002-31-01" + />+ +
Generates a tagdiff report for all the changes that have been made
+in the jakarta-ant
module in january 2002, with rootdir
indicating that
+the actual location of the jakarta-ant
module in cvs is jakarta/ant
+rather than jakarta-ant
.
+
Ant includes a basic XSLT stylesheet that you can use to generate a HTML report based on the xml output. The following example illustrates diff --git a/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java b/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java index 4956ec73d..168c8b2a5 100644 --- a/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java +++ b/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java @@ -64,8 +64,7 @@ import java.io.UnsupportedEncodingException; 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 @@ import org.apache.tools.ant.util.FileUtils; * @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 @@ -119,11 +117,6 @@ public class CvsTagDiff extends Task { */ 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 */ @@ -159,48 +152,6 @@ public class CvsTagDiff extends Task { */ 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. */ @@ -208,36 +159,6 @@ public class CvsTagDiff extends Task { m_package = p; } - /** - * 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. * @@ -299,15 +220,15 @@ public class CvsTagDiff extends Task { + (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);