public BuildChooser getBuildChooser() { if (buildChooser==null) buildChooser = new DefaultBuildChooser(); return buildChooser; }
throws GitException, IOException, InterruptedException { final Collection<Revision> candidates = super.getCandidateRevisions(isPollCall, branchSpec, git, listener, data, context);
verbose(listener,"getCandidateRevisions({0},{1},,,{2}) considering branches to build",isPollCall,branchSpec,data); if (isAdvancedSpec(branchSpec)) return getAdvancedCandidateRevisions(isPollCall,listener,new GitUtils(listener,git),data, context); Revision revision = new Revision(sha1); revision.getBranches().add(new Branch("detached", sha1)); verbose(listener,"Will build the detached SHA1 {0}",sha1); return Collections.singletonList(revision); } catch (GitException e) { verbose(listener, "Not a valid SHA1 {0}", branchSpec); String repository = config.getName(); String fqbn = repository + "/" + branchSpec; verbose(listener, "Qualifying {0} as a branch in repository {1} -> {2}", branchSpec, repository, fqbn); revisions.addAll(getHeadRevision(isPollCall, fqbn, git, listener, data)); verbose(listener, "Qualifying {0} as a branch in repository {1} -> {2}", branchSpec, repository, fqbn); possibleQualifiedBranches.add(fqbn); verbose(listener, "Qualifying {0} as a branch in repository {1} -> {2}", branchSpec, repository, fqbn); possibleQualifiedBranches.add(fqbn); revisions.addAll(getHeadRevision(isPollCall, fqbn, git, listener, data)); revisions = getHeadRevision(isPollCall, branchSpec, git, listener, data); if (!revisions.isEmpty()) { verbose(listener, "{0} seems to be a non-branch reference (tag?)");
throws GitException, IOException { verbose(listener, "getCandidateRevisions({0},{1},,,{2}) considering branches to build", isPollCall, singleBranch, data); return getAdvancedCandidateRevisions(isPollCall, listener, new GitUtils(listener, git), data); Revision revision = new Revision(sha1); revision.getBranches().add(new Branch("detached", sha1)); verbose(listener, "Will build the detached SHA1 {0}", sha1); return Collections.singletonList(revision); } catch (GitException e) { verbose(listener, "Not a valid SHA1 {0}", singleBranch); verbose(listener, "{0} is not a tag. Qualifying with the repository {1} a a branch", singleBranch, repository); verbose(listener, "rev-parse {0} -> {1}", singleBranch, sha1); verbose(listener, "{0} has already been built", sha1); return emptyList(); verbose(listener, "Found a new commit {0} to be built on {1}", sha1, singleBranch); verbose(listener, "Failed to rev-parse: {0}", singleBranch); return emptyList();
private Collection<Revision> getHeadRevision(boolean isPollCall, String singleBranch, GitClient git, TaskListener listener, BuildData data) throws InterruptedException { try { ObjectId sha1 = git.revParse(singleBranch); verbose(listener, "rev-parse {0} -> {1}", singleBranch, sha1); verbose(listener, "{0} has already been built", sha1); return emptyList(); verbose(listener, "Found a new commit {0} to be built on {1}", sha1, singleBranch); Revision revision = new Revision(sha1); revision.getBranches().add(new Branch(singleBranch, sha1)); verbose(listener, "Failed to rev-parse: {0}", singleBranch); return emptyList();
throws GitException, IOException { verbose(listener, "getCandidateRevisions({0},{1},,,{2}) considering branches to build", isPollCall, singleBranch, data); return getAdvancedCandidateRevisions(isPollCall, listener, new GitUtils(listener, git), data); Revision revision = new Revision(sha1); revision.getBranches().add(new Branch("detached", sha1)); verbose(listener, "Will build the detached SHA1 {0}", sha1); return Collections.singletonList(revision); } catch (GitException e) { verbose(listener, "Not a valid SHA1 {0}", singleBranch); verbose(listener, "{0} is not a tag. Qualifying with the repository {1} a a branch", singleBranch, repository); verbose(listener, "rev-parse {0} -> {1}", singleBranch, sha1); verbose(listener, "{0} has already been built", sha1); return emptyList(); verbose(listener, "Found a new commit {0} to be built on {1}", sha1, singleBranch); verbose(listener, "Failed to rev-parse: {0}", singleBranch); return emptyList();
verbose(listener, "Starting with all the branches: {0}", revs); verbose(listener, "Ignoring {0} because it doesn't match branch specifier", b); j.remove(); verbose(listener, "Ignoring {0} because we don't care about any of the branches that point to it", r); i.remove(); verbose(listener, "After branch filtering: {0}", revs); verbose(listener, "After non-tip filtering: {0}", revs); verbose(listener, "Removing what's already been built: {0}", data.getBuildsByBranchName()); for (Iterator<Revision> i = revs.iterator(); i.hasNext();) { Revision r = i.next(); verbose(listener, "After filtering out what's already been built: {0}", revs); verbose(listener, "Nothing seems worth building, so falling back to the previously built revision: {0}", data.getLastBuiltRevision()); return Collections.singletonList(data.getLastBuiltRevision());
/** * A convenience constructor that sets everything to default. * * @param repositoryUrl Repository URL to clone from. * @throws java.io.IOException exception. */ public GitSCM(String repositoryUrl) throws IOException, Descriptor.FormException { this( DescriptorImpl.createRepositoryConfigurations(new String[]{repositoryUrl}, new String[]{null}, new String[]{null}), Collections.singletonList(new BranchSpec("")), new PreBuildMergeOptions(), false, Collections.<SubmoduleConfig>emptyList(), false, false, new DefaultBuildChooser(), null, null, false, null, null, null, false, false, false, null, null, false, null, false); }
verbose(listener, "Starting with all the branches: {0}", revs); verbose(listener, "Ignoring {0} because it doesn't match branch specifier", b); j.remove(); verbose(listener, "Ignoring {0} because we don't care about any of the branches that point to it", r); i.remove(); verbose(listener, "After branch filtering: {0}", revs); verbose(listener, "After non-tip filtering: {0}", revs); verbose(listener, "Removing what's already been built: {0}", data.getBuildsByBranchName()); for (Iterator<Revision> i = revs.iterator(); i.hasNext();) { Revision r = i.next(); verbose(listener, "After filtering out what's already been built: {0}", revs); return revs; verbose(listener, "Nothing seems worth building, so falling back to the previously built revision: {0}", data.getLastBuiltRevision()); return Collections.singletonList(data.getLastBuiltRevision());
/** * A convenience constructor that sets everything to default. * * @param repositoryUrl Repository URL to clone from. * @throws java.io.IOException exception. */ public GitSCM(String repositoryUrl) throws IOException { this( DescriptorImpl.createRepositoryConfigurations(new String[]{repositoryUrl}, new String[]{null}, new String[]{null}), Collections.singletonList(new BranchSpec("")), new PreBuildMergeOptions(), false, Collections.<SubmoduleConfig>emptyList(), false, false, new DefaultBuildChooser(), null, null, false, null, null, null, null, false, false, null, null, false); }
verbose(listener, "Starting with all the branches: {0}", revs); verbose(listener, "Ignoring {0} because it doesn''t match branch specifier", b); j.remove(); Branch b = j.next(); if (HEAD.matches(b.getName(), env)) { verbose(listener, "Ignoring {0} because there''s named branch for this revision", b.getName()); j.remove(); verbose(listener, "Ignoring {0} because we don''t care about any of the branches that point to it", r); i.remove(); verbose(listener, "After branch filtering: {0}", revs); verbose(listener, "After non-tip filtering: {0}", revs); verbose(listener, "Removing what''s already been built: {0}", data.getBuildsByBranchName()); Revision lastBuiltRevision = data.getLastBuiltRevision(); for (Iterator<Revision> i = revs.iterator(); i.hasNext();) { verbose(listener, "After filtering out what''s already been built: {0}", revs); verbose(listener, "Nothing seems worth building, so falling back to the previously built revision: {0}", data.getLastBuiltRevision()); return Collections.singletonList(utils.sortBranchesForRevision(lastBuiltRevision, gitSCM.getBranches(), env));
public BuildChooser getBuildChooser() { BuildChooser bc; BuildChooserSetting bcs = getExtensions().get(BuildChooserSetting.class); if (bcs!=null) bc = bcs.getBuildChooser(); else bc = new DefaultBuildChooser(); bc.gitSCM = this; return bc; }
buildChooser = new DefaultBuildChooser();
buildChooser = new DefaultBuildChooser();