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

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

    XMLWordPrintable

Details

    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

            kbell Kevin Bell added a comment -

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

            kbell Kevin Bell added a comment - Pull request #1 has been merged (at least the part relevant to this issue)
            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.

            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.
            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.

            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.
            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?

            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?

            People

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

              Dates

                Created:
                Updated:
                Resolved: