Browse Source

Support CVSNT in <cvsversion>, submitted by Andy Wood. PR 31409.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705225 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 17 years ago
parent
commit
8983c83c51
2 changed files with 13 additions and 9 deletions
  1. +3
    -0
      WHATSNEW
  2. +10
    -9
      src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java

+ 3
- 0
WHATSNEW View File

@@ -443,6 +443,9 @@ Other changes:
the log file. the log file.
Bugzilla Report 38029. Bugzilla Report 38029.


* <cvsversion> is supposed to support CVSNT now.
Bugzilla Report 31409.

Changes from Ant 1.7.0 TO Ant 1.7.1 Changes from Ant 1.7.0 TO Ant 1.7.1
============================================= =============================================




+ 10
- 9
src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java View File

@@ -118,28 +118,29 @@ public class CvsVersion extends AbstractCvsTask {
StringTokenizer st = new StringTokenizer(output); StringTokenizer st = new StringTokenizer(output);
boolean client = false; boolean client = false;
boolean server = false; boolean server = false;
boolean cvs = false;
String cvs = null;
while (st.hasMoreTokens()) { while (st.hasMoreTokens()) {
String currentToken = st.nextToken(); String currentToken = st.nextToken();
if (currentToken.equals("Client:")) { if (currentToken.equals("Client:")) {
client = true; client = true;
} else if (currentToken.equals("Server:")) { } else if (currentToken.equals("Server:")) {
server = true; 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()) { if (st.hasMoreTokens()) {
clientVersion = st.nextToken();
clientVersion = st.nextToken() + cvs;
} }
client = false; client = false;
cvs = false;
} else if (server && cvs) {
cvs = null;
} else if (server && cvs != null) {
if (st.hasMoreTokens()) { if (st.hasMoreTokens()) {
serverVersion = st.nextToken();
serverVersion = st.nextToken() + cvs;
} }
server = false; server = false;
cvs = false;
cvs = null;
} }


} }


Loading…
Cancel
Save