From 8983c83c513818f041f772ca83d095d5637fecda Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 16 Oct 2008 12:33:44 +0000 Subject: [PATCH] Support CVSNT in , submitted by Andy Wood. PR 31409. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@705225 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 3 +++ .../tools/ant/taskdefs/cvslib/CvsVersion.java | 19 ++++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index a1b7e2b2f..a5fff7862 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -443,6 +443,9 @@ Other changes: the log file. Bugzilla Report 38029. + * is supposed to support CVSNT now. + Bugzilla Report 31409. + Changes from Ant 1.7.0 TO Ant 1.7.1 ============================================= diff --git a/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java b/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java index b4a60a90f..c0ba641a1 100644 --- a/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java +++ b/src/main/org/apache/tools/ant/taskdefs/cvslib/CvsVersion.java @@ -118,28 +118,29 @@ public class CvsVersion extends AbstractCvsTask { 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; } }