Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-1696

CVS compute changelog code throws an exception if the CVS version string is non-standard

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: cvs-plugin
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      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;

        Attachments

          Activity

          Hide
          scm_issue_link SCM/JIRA link daemon added a comment -

          Code changed in hudson
          User: : kohsuke
          Path:
          trunk/hudson/main/core/src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java
          trunk/www/changelog.html
          http://fisheye4.cenqua.com/changelog/hudson/?cs=9334
          Log:
          [FIXED JENKINS-1696] applied a patch. Be more lenient in comparing a version. Fixed in 1.216.

          Show
          scm_issue_link SCM/JIRA link daemon added a comment - Code changed in hudson User: : kohsuke Path: trunk/hudson/main/core/src/main/java/hudson/org/apache/tools/ant/taskdefs/cvslib/ChangeLogTask.java trunk/www/changelog.html http://fisheye4.cenqua.com/changelog/hudson/?cs=9334 Log: [FIXED JENKINS-1696] applied a patch. Be more lenient in comparing a version. Fixed in 1.216.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            frankt frankt
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: