Package hudson.scm

Class SCMDescriptor<T extends SCM>

    • Field Detail

      • repositoryBrowser

        public final transient Class<? extends RepositoryBrowser> repositoryBrowser
        If this SCM has corresponding RepositoryBrowser, that type. Otherwise this SCM will not have any repository browser.
    • Constructor Detail

      • SCMDescriptor

        protected SCMDescriptor​(Class<? extends RepositoryBrowser> repositoryBrowser)
        Infers the type of the corresponding SCM from the outer class. This version works when you follow the common convention, where a descriptor is written as the static nested class of the describable class.
    • Method Detail

      • getGeneration

        public int getGeneration()
        No longer used by default.
        Incremented every time a new SCM instance is created from this descriptor. This is used to invalidate cache of SCM.getEffectiveBrowser(). Due to the lack of synchronization and serialization, this field doesn't really count the # of instances created to date, but it's good enough for the cache invalidation.
      • incrementGeneration

        public void incrementGeneration()
        No longer used by default.
        Increments the generation value getGeneration() by one atomically.
      • load

        public void load()
        Description copied from class: Descriptor
        Loads the data from the disk into this object.

        The constructor of the derived class must call this method. (If we do that in the base class, the derived class won't get a chance to set default values.)

        Specified by:
        load in interface Loadable
        load in class Descriptor<SCM>
      • isBrowserReusable

        public boolean isBrowserReusable​(T x,
                                         T y)
        No longer used by default. SCM.getKey() could be used to implement similar features if needed.
        Optional method used by the automatic SCM browser inference.

        Implementing this method allows Hudson to reuse RepositoryBrowser configured for one project to be used for other "compatible" projects.

        SCM.guessBrowser() is more robust since it does not require another project.

        true if the two given SCM configurations are similar enough that they can reuse RepositoryBrowser between them.
      • isApplicable

        public boolean isApplicable​(Job project)
        Allows SCMDescriptors to choose which projects it wants to be configurable against.

        When this method returns false, this SCM will not appear in the configuration screen for the given project. The default is true for AbstractProject but false for Job.