antoine 2003/11/06 12:39:53 Modified: . WHATSNEW src/main/org/apache/tools/ant/taskdefs/cvslib CvsTagDiff.java CvsTagEntry.java Log: Allow reporting on multiple modules, aliased or not. Also report the previous revision of deleted files when it is available. PR: 21373 PR: 22877 Revision Changes Path 1.511 +6 -0 ant/WHATSNEW Index: WHATSNEW =================================================================== RCS file: /home/cvs/ant/WHATSNEW,v retrieving revision 1.510 retrieving revision 1.511 diff -u -r1.510 -r1.511 --- WHATSNEW 24 Oct 2003 05:53:13 -0000 1.510 +++ WHATSNEW 6 Nov 2003 20:39:52 -0000 1.511 @@ -209,6 +209,12 @@ element tagdiff of the xml output Bugzilla Report 16081. +* <cvstagdiff> had a problem with aliased modules and with requests for multiple modules + Bugzilla Reports 21373 and 22877. + +* <cvstagdiff> could not parse properly the revision number of new files with CVS 1.11.9 or higher + Bugzilla Report 24406. + * <fixcrlf> make fixcrlf create its temporary files in the default directory of FileUtils#createTempFile instead of the destination dir of fixcrlf. Bugzilla Report 20870. 1.19 +27 -10 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.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- CvsTagDiff.java 6 Nov 2003 09:21:36 -0000 1.18 +++ CvsTagDiff.java 6 Nov 2003 20:39:53 -0000 1.19 @@ -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,13 +313,13 @@ 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 -//File apps/websphere/lib/something.jar is new; current revision 1.2 -//CVS 1.11.9 -//File apps/websphere/lib/something.jar is new; cvstag_2003_11_03_2 revision 1.2 // it is a new file // set the revision but not the prevrevision String filename = line.substring(0, index); @@ -336,7 +348,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.3 +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.3 diff -u -r1.2 -r1.3 --- CvsTagEntry.java 10 Feb 2003 14:13:43 -0000 1.2 +++ CvsTagEntry.java 6 Nov 2003 20:39:53 -0000 1.3 @@ -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]