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

CVSTag plugin does not work for Branches - only HEAD

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • cvs-tag-plugin
    • None
    • Platform: All, OS: All

      The CVSTag plugin does not work for branches - it will only work for the head
      due to the code listed below missing out specification of the branch (presuming
      that there is one)

      HUDSON/plugins/cvs-tag/src/main/java/hudson/plugins/cvs_tag/CVSTagPlugin.java -
      starts at line 84

      // cvs -d cvsRoot rtag -D toDate tagName modules
      cmd.add(scm.getDescriptor().getCvsExe(), "-d", scm.getCvsRoot(), "rtag", "-D",
      date, tagName, modules);
      logger.println("Executing tag command: " + cmd.toStringWithQuote());

      The code can be fixed by replacing it with this fragment which addes the branch
      argument

      ArgumentListBuilder cmd = new ArgumentListBuilder();

      // BRANCH
      // cvs -d cvsRoot rtag -r BRANCH_NAME -D tagDate tagName modules
      if (scm.getBranch()!=null)

      { cmd.add(scm.getDescriptor().getCvsExe(), "-d", scm.getCvsRoot(), "rtag","-r", scm.getBranch(), "-D", date, tagName, modules); }

      // NO BRANCH
      // cvs -d cvsRoot rtag -D toDate tagName modules
      else

      { cmd.add(scm.getDescriptor().getCvsExe(), "-d", scm.getCvsRoot(), "rtag", "-D", date, tagName, modules); }

      logger.println("Executing tag command: " +
      cmd.toStringWithQuote());

            btrim btrim
            toddlmorgan toddlmorgan
            Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: