-
Bug
-
Resolution: Fixed
-
Major
-
None
-
Platform: All, OS: All
If the version string returned by the command 'cvs version' is non-standard
in format, the 'supportsCvsLogWithSOption' method in
hudson.org.apache.tools.ant.taskdefs.cvslib.ChageLogTask.java throws an
exception.
My company is currently running a 4 year old version of CVS on the corporate
CVS server, and they are unwilling/unresponsive with respect to a fix.
The command 'cvs version' returns:
Client: Concurrent Versions System (CVS) 1.11.22 (client/server)
Server: Concurrent Versions System (CVS) '1.11.17'-FreeBSD (client/server)
The code in ChangeLogTask.java sees the first single quote and thinks that
it is all done.
I was hoping that someone could check in the following code change:
(I think/hope that this change is generic enough to help others as well.)
> svn diff -x -bw ChangeLogTask.java
Index: ChangeLogTask.java
===================================================================
— ChangeLogTask.java (revision 9225)
+++ ChangeLogTask.java (working copy)
@@ -333,12 +333,18 @@
while (mySt.hasMoreTokens()) {
String s = mySt.nextToken();
int i = 0;
- for (i = 0; i < s.length(); i++) {
+ int startpos = 0;
+ for (startpos = 0; startpos < s.length(); startpos++)Unknown macro: {+ if (Character.isDigit(s.charAt(startpos))) { + break; + }+ }+ for (i = startpos; i < s.length(); i++)
Unknown macro: { if (!Character.isDigit(s.charAt(i))) { break; } } - String s2 = s.substring(0, i);
+ String s2 = s.substring(startpos, i);
version = version + counter * Long.parseLong(s2);
if (counter == 1) {
break;