Package hudson.plugins.git.util
Class DefaultBuildChooser
- java.lang.Object
-
- hudson.plugins.git.util.BuildChooser
-
- hudson.plugins.git.util.DefaultBuildChooser
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<BuildChooser>
,Serializable
- Direct Known Subclasses:
AncestryBuildChooser
public class DefaultBuildChooser extends BuildChooser
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultBuildChooser.DescriptorImpl
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Field Summary
-
Fields inherited from class hudson.plugins.git.util.BuildChooser
gitSCM
-
-
Constructor Summary
Constructors Constructor Description DefaultBuildChooser()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<hudson.plugins.git.Revision>
getCandidateRevisions(boolean isPollCall, String branchSpec, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, BuildData data, BuildChooserContext context)
Determines which Revisions to build.-
Methods inherited from class hudson.plugins.git.util.BuildChooser
all, allApplicableTo, getCandidateRevisions, getCandidateRevisions, getDescriptor, getDisplayName, prepareWorkingTree, prevBuildForChangelog, prevBuildForChangelog, prevBuildForChangelog
-
-
-
-
Method Detail
-
getCandidateRevisions
public Collection<hudson.plugins.git.Revision> getCandidateRevisions(boolean isPollCall, String branchSpec, org.jenkinsci.plugins.gitclient.GitClient git, TaskListener listener, BuildData data, BuildChooserContext context) throws hudson.plugins.git.GitException, IOException, InterruptedException
Determines which Revisions to build. If only one branch is chosen and only one repository is listed, then just attempt to find the latest revision number for the chosen branch. If multiple branches are selected or the branches include wildcards, then use the advanced usecase as defined in the getAdvancedCandidateRevisions method.- Overrides:
getCandidateRevisions
in classBuildChooser
- Parameters:
isPollCall
- true if this method is called from pollChanges.branchSpec
- contains the name of a single branch to be built this will be non-null only in the simple case, in advanced cases with multiple repositories and/or branches specified then this value will be null.git
- Used for invoking Gitlistener
- build logdata
- build data to be used Information that captures what we did during the last build.context
- Object that provides access back to the model object. This is because the build chooser can be invoked on an agent where there's no direct access to the build/project for which this is invoked. IfisPollCall
is false, then call back to both project and build are available. IfisPollCall
is true, then only the callback to the project is available as there's no contextual build object.- Returns:
- the candidate revision. Can be an empty set to indicate that there's nothing to build.
- Throws:
IOException
- on input or output errorhudson.plugins.git.GitException
- on git errorInterruptedException
- when interrupted
-
-