antoine 2003/11/06 13:20:33
Modified: docs/manual/CoreTasks Tag: ANT_16_BRANCH cvstagdiff.html
src/main/org/apache/tools/ant/taskdefs/cvslib Tag:
ANT_16_BRANCH CvsTagDiff.java CvsTagEntry.java
Log:
Merge from HEAD
fixes issues with reporting on an alias, or reporting on multiple modules.
PR: 21373
PR: 22877
Revision Changes Path
No revision
No revision
1.8.2.2 +19 -15 ant/docs/manual/CoreTasks/cvstagdiff.html
Index: cvstagdiff.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/cvstagdiff.html,v
retrieving revision 1.8.2.1
retrieving revision 1.8.2.2
diff -u -r1.8.2.1 -r1.8.2.2
--- cvstagdiff.html 9 Oct 2003 21:01:06 -0000 1.8.2.1
+++ cvstagdiff.html 6 Nov 2003 21:20:33 -0000 1.8.2.2
@@ -48,11 +48,6 @@
<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>
@@ -79,7 +74,10 @@
</tr>
<tr>
<td valign="top">package</td>
- <td valign="top">the package/module to analyze.</td>
+ <td valign="top">the package/module to analyze.<br>
+ Since ant 1.6
+ multiple packages separated by spaces are possible.
+ aliases corresponding to different modules are also possible</td>
<td align="center" valign="top">Yes</td>
</tr>
<tr>
@@ -132,16 +130,14 @@
<pre> <cvstagdiff
destfile="tagdiff.xml"
- package="ant"
- rootdir="apache/ant"
- startDate="2002-01-01"
- endDate="2002-31-01"
+ package="ant jakarta-gump"
+ startDate="2003-01-01"
+ endDate="2003-31-01"
/></pre>
<p>Generates a tagdiff report for all the changes that have been made
-in the <code>ant</code> module in january 2002, with <code>rootdir</code>
indicating that
-the actual location of the <code>ant</code> module in cvs is
<code>apache/ant</code>
-rather than <code>ant</code>. In this example <code>cvsRoot</code>
+in the <code>ant</code> and <code>jakarta-gump</code> modules in january
2003.
+In this example <code>cvsRoot</code>
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>
@@ -161,9 +157,17 @@
</style>
</pre>
-<h4>Sample Output</h4>
+<h4>Output</h4>
<p>
-The cvsroot and package attributes of the tagdiff element are new in ant 1.6.
+The cvsroot and package attributes of the tagdiff element are new in ant
1.6.<br>
+Notes on entry attributes :
+<table border="1">
+<tr><th>Attribute</th><th>Comment</th></tr>
+<tr><td>name</td><td>when reporting on one package, the package name is
removed from the output</td></tr>
+<tr><td>revision</td><td>supplied for files which exist at the end of the
reporting period</td></tr>
+<tr><td>prevrevision</td><td>supplied for files which exist at the beginning
of the reporting period.<br>
+Old CVS servers do not supply it for deleted files. CVS 1.12.2 supplies
it.</td></tr>
+</table>
</p>
<pre>
<?xml version="1.0" encoding="UTF-8"?>
No revision
No revision
1.16.2.3 +27 -6
ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java
Index: CvsTagDiff.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagDiff.java,v
retrieving revision 1.16.2.2
retrieving revision 1.16.2.3
diff -u -r1.16.2.2 -r1.16.2.3
--- CvsTagDiff.java 6 Nov 2003 09:27:21 -0000 1.16.2.2
+++ CvsTagDiff.java 6 Nov 2003 21:20:33 -0000 1.16.2.3
@@ -62,6 +62,8 @@
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;
import java.util.Vector;
+import java.util.StringTokenizer;
+
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.AbstractCvsTask;
@@ -243,7 +245,11 @@
addCommandArgument("-D");
addCommandArgument(myendDate);
}
- addCommandArgument(mypackage);
+ // support multiple packages
+ StringTokenizer myTokenizer = new StringTokenizer(mypackage);
+ while (myTokenizer.hasMoreTokens()) {
+ addCommandArgument(myTokenizer.nextToken());
+ }
// force command not to be null
setCommand("");
File tmpFile = null;
@@ -284,15 +290,21 @@
reader = new BufferedReader(new FileReader(tmpFile));
// entries are of the form:
+ //CVS 1.11
// File module/filename is new; current revision 1.1
+ //CVS 1.11.9
+ // File module/filename is new; cvstag_2003_11_03_2 revision 1.1
// or
// File module/filename changed from revision 1.4 to 1.6
// or
// File module/filename is removed; not included in
// release tag SKINLF_12
-
+ //CVS 1.11.9
+ // File testantoine/antoine.bat is removed; TESTANTOINE_1
revision 1.1.1.1
+ //
// get rid of 'File module/"
- int headerLength = FILE_STRING.length() + mypackage.length() + 1;
+ String toBeRemoved = FILE_STRING + mypackage + "/";
+ int headerLength = toBeRemoved.length();
Vector entries = new Vector();
String line = reader.readLine();
@@ -301,7 +313,11 @@
while (null != line) {
if (line.length() > headerLength) {
- line = line.substring(headerLength);
+ if (line.startsWith(toBeRemoved)) {
+ line = line.substring(headerLength);
+ } else {
+ line = line.substring(FILE_STRING.length());
+ }
if ((index = line.indexOf(FILE_IS_NEW)) != -1) {
//CVS 1.11
@@ -336,7 +352,12 @@
} else if ((index = line.indexOf(FILE_WAS_REMOVED)) !=
-1) {
// it is a removed file
String filename = line.substring(0, index);
- entry = new CvsTagEntry(filename);
+ String rev = null;
+ int indexrev = -1;
+ if ((indexrev = line.indexOf(REVISION, index)) !=
-1) {
+ rev = line.substring(indexrev +
REVISION.length());
+ }
+ entry = new CvsTagEntry(filename, null, rev);
entries.addElement(entry);
log(entry.toString(), Project.MSG_VERBOSE);
}
1.2.2.1 +4 -1
ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java
Index: CvsTagEntry.java
===================================================================
RCS file:
/home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsTagEntry.java,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -u -r1.2 -r1.2.2.1
--- CvsTagEntry.java 10 Feb 2003 14:13:43 -0000 1.2
+++ CvsTagEntry.java 6 Nov 2003 21:20:33 -0000 1.2.2.1
@@ -91,8 +91,11 @@
public String toString() {
StringBuffer buffer = new StringBuffer();
buffer.append(m_filename);
- if ((m_revision == null) && (m_prevRevision == null)) {
+ if ((m_revision == null)) {
buffer.append(" was removed");
+ if(m_prevRevision != null) {
+ buffer.append("; previous revision was
").append(m_prevRevision);
+ }
} else if (m_revision != null && m_prevRevision == null) {
buffer.append(" is new; current revision is ")
.append(m_revision);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]