Author: bodewig Date: Thu Oct 16 05:33:44 2008 New Revision: 705225 URL: http://svn.apache.org/viewvc?rev=705225&view=rev Log: Support CVSNT in <cvsversion>, submitted by Andy Wood. PR 31409.
Modified: ant/core/trunk/WHATSNEW ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java Modified: ant/core/trunk/WHATSNEW URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=705225&r1=705224&r2=705225&view=diff ============================================================================== --- ant/core/trunk/WHATSNEW (original) +++ ant/core/trunk/WHATSNEW Thu Oct 16 05:33:44 2008 @@ -443,6 +443,9 @@ the log file. Bugzilla Report 38029. + * <cvsversion> is supposed to support CVSNT now. + Bugzilla Report 31409. + Changes from Ant 1.7.0 TO Ant 1.7.1 ============================================= Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java?rev=705225&r1=705224&r2=705225&view=diff ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java Thu Oct 16 05:33:44 2008 @@ -118,28 +118,29 @@ StringTokenizer st = new StringTokenizer(output); boolean client = false; boolean server = false; - boolean cvs = false; + String cvs = null; while (st.hasMoreTokens()) { String currentToken = st.nextToken(); if (currentToken.equals("Client:")) { client = true; } else if (currentToken.equals("Server:")) { server = true; - } else if (currentToken.equals("(CVS)")) { - cvs = true; + } else if (currentToken.startsWith("(CVS") + && currentToken.endsWith(")")) { + cvs = currentToken.length() == 5 ? "" : " " + currentToken; } - if (client && cvs) { + if (client && cvs != null) { if (st.hasMoreTokens()) { - clientVersion = st.nextToken(); + clientVersion = st.nextToken() + cvs; } client = false; - cvs = false; - } else if (server && cvs) { + cvs = null; + } else if (server && cvs != null) { if (st.hasMoreTokens()) { - serverVersion = st.nextToken(); + serverVersion = st.nextToken() + cvs; } server = false; - cvs = false; + cvs = null; } }