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

MultiSCMRevisionState.revisionStates cannot differentiate multiple instances of a single SCM type

    Details

    • Similar Issues:

      Description

      public void add(String scmClass, SCMRevisionState scmState) {
        revisionStates.put(scmClass, scmState);
      }
      ...
      revisionStates.add(scm.getClass().getName(), scmState);
      

      cannot work when you want to use more than one copy of a given SCM plugin in a single job. First of all you should use scm.getType() rather than hardcoding the class name. Second you should include the result of getModuleRoots in the hash key.

        Attachments

          Issue Links

            Activity

            Hide
            jglick Jesse Glick added a comment - - edited

            Serialized build.xml files always seem to have an empty state:

            <org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState>
              <revisionStates/>
            </org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState>
            

            Not sure what that means. XStream problem, or does it just happen to be empty when the build is persisted?

            Show
            jglick Jesse Glick added a comment - - edited Serialized build.xml files always seem to have an empty state: <org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState> <revisionStates/> </org.jenkinsci.plugins.multiplescms.MultiSCMRevisionState> Not sure what that means. XStream problem, or does it just happen to be empty when the build is persisted?
            Hide
            abayer Andrew Bayer added a comment -

            fwiw, the git plugin works around this by having an optional unique field to identify each instance. The MultipleSCMs plugin is able to use that somehow to distinguish between multiple repos.

            Show
            abayer Andrew Bayer added a comment - fwiw, the git plugin works around this by having an optional unique field to identify each instance. The MultipleSCMs plugin is able to use that somehow to distinguish between multiple repos.
            Hide
            jglick Jesse Glick added a comment -

            I do not see anything in multiplescms that would do anything special with the Git plugin...?

            Fix available in pull request #1.

            Show
            jglick Jesse Glick added a comment - I do not see anything in multiplescms that would do anything special with the Git plugin...? Fix available in pull request #1.
            Hide
            kbell Kevin Bell added a comment -

            Pull request #1 has been merged (at least the part relevant to this issue)

            Show
            kbell Kevin Bell added a comment - Pull request #1 has been merged (at least the part relevant to this issue)

              People

              • Assignee:
                kbell Kevin Bell
                Reporter:
                jglick Jesse Glick
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: