Skip to content
Permalink
Browse files

[FIXED JENKINS-23365] Noting merge of #1257.

  • Loading branch information
jglick committed Jun 9, 2014
1 parent 38e81a6 commit 7423d30e9e3599889597547295e1a8a659fb19d5
@@ -61,6 +61,9 @@
<li class=rfe>
Support the range notation for pagination in API
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23228">issue 23228</a>)
<li class=rfe>
API changes allowing new job types to use SCM plugins.
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-23365">issue 23365</a>)
<li class=rfe>
API changes allowing to create nested launchers (<code>DecoratedLauncher</code>)
(<a href="https://issues.jenkins-ci.org/browse/JENKINS-19454">issue 19454</a>)
@@ -71,7 +71,7 @@

/**
* Called when the cause is registered.
* @since TODO
* @since 1.568
*/
public void onAddedTo(@Nonnull Run build) {
if (build instanceof AbstractBuild) {
@@ -90,7 +90,7 @@ public void onAddedTo(AbstractBuild build) {
* Called when a build is loaded from disk.
* Useful in case the cause needs to keep a build reference;
* this ought to be {@code transient}.
* @since TODO
* @since 1.568
*/
public void onLoad(@Nonnull Run<?,?> build) {
if (build instanceof AbstractBuild) {
@@ -63,7 +63,7 @@
* Should be called immediately after {@link SCM#checkout(Run, Launcher, FilePath, TaskListener, File)} is called.
* @param pollingBaseline information about what actually was checked out, if that is available, and this checkout is intended to be included in the build’s polling (if it does any at all)
* @throws Exception if the checkout should be considered failed
* @since TODO
* @since 1.568
*/
public void onCheckout(Run<?,?> build, SCM scm, FilePath workspace, TaskListener listener, @CheckForNull File changelogFile, @CheckForNull SCMRevisionState pollingBaseline) throws Exception {}

@@ -106,6 +106,7 @@ public void onCheckout(Run<?,?> build, SCM scm, FilePath workspace, TaskListener
* @throws Exception
* If any exception is thrown from this method, it will be recorded
* and causes the build to fail.
* @since 1.568
*/
public void onChangeLogParsed(Run<?,?> build, SCM scm, TaskListener listener, ChangeLogSet<?> changelog) throws Exception {
if (build instanceof AbstractBuild && listener instanceof BuildListener && Util.isOverridden(SCMListener.class, getClass(), "onChangeLogParsed", AbstractBuild.class, BuildListener.class, ChangeLogSet.class)) {
@@ -118,6 +119,9 @@ public void onChangeLogParsed(AbstractBuild<?,?> build, BuildListener listener,
onChangeLogParsed((Run) build, build.getProject().getScm(), listener, changelog);
}

/**
* @since 1.568
*/
@SuppressWarnings("deprecation")
public static Collection<? extends SCMListener> all() {
Jenkins j = Jenkins.getInstance();
@@ -52,6 +52,9 @@
@Deprecated
protected transient /*final*/ AbstractBuild build;

/**
* @since 1.568
*/
protected AbstractScmTagAction(Run<?,?> run) {
this.run = run;
this.build = run instanceof AbstractBuild ? (AbstractBuild) run : null;
@@ -74,6 +77,9 @@ protected Permission getPermission() {
return SCM.TAG;
}

/**
* @since 1.568
*/
public Run<?,?> getRun() {
return run;
}
@@ -76,6 +76,7 @@
* are registered, the object may already contain some markups when this
* method is invoked. Never null. {@link MarkupText#getText()} on this instance
* will return the same string as {@link Entry#getMsgEscaped()}.
* @since 1.568
*/
public void annotate(Run<?,?> build, Entry change, MarkupText text) {
if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogAnnotator.class, getClass(), "annotate", AbstractBuild.class, Entry.class, MarkupText.class)) {
@@ -41,6 +41,9 @@
*/
public abstract class ChangeLogParser {

/**
* @since 1.568
*/
public ChangeLogSet<? extends Entry> parse(Run build, RepositoryBrowser<?> browser, File changelogFile) throws IOException, SAXException {
if (build instanceof AbstractBuild && Util.isOverridden(ChangeLogParser.class, getClass(), "parse", AbstractBuild.class, File.class)) {
return parse((AbstractBuild) build, changelogFile);
@@ -62,6 +62,9 @@
public final AbstractBuild<?,?> build;
private final RepositoryBrowser</* ideally T */?> browser;

/**
* @since 1.568
*/
protected ChangeLogSet(Run<?,?> run, RepositoryBrowser<?> browser) {
this.run = run;
build = run instanceof AbstractBuild ? (AbstractBuild) run : null;
@@ -79,10 +82,16 @@ protected ChangeLogSet(AbstractBuild<?, ?> build) {
return build.getParent().getScm().getEffectiveBrowser();
}

/**
* @since 1.568
*/
public Run<?,?> getRun() {
return run;
}

/**
* @since 1.568
*/
public RepositoryBrowser<?> getBrowser() {
return browser;
}
@@ -116,6 +125,7 @@ public String getKind() {

/**
* Constant instance that represents no changes.
* @since 1.568
*/
public static ChangeLogSet<? extends ChangeLogSet.Entry> createEmpty(Run build) {
return new EmptyChangeLogSet(build);
@@ -209,7 +209,7 @@ public boolean requiresWorkspaceForPolling() {
* true if {@link SCM} is OK to let Hudson proceed with deleting the workspace.
* False to veto the workspace deletion.
*
* @since 1.246
* @since 1.568
*/
public boolean processWorkspaceBeforeDeletion(Job<?,?> project, FilePath workspace, Node node) throws IOException, InterruptedException {
if (project instanceof AbstractProject) {
@@ -308,6 +308,7 @@ public boolean pollChanges(AbstractProject<?,?> project, Launcher launcher, File
* @throws InterruptedException
* interruption is usually caused by the user aborting the computation.
* this exception should be simply propagated all the way up.
* @since 1.568
*/
public SCMRevisionState calcRevisionsFromBuild(Run<?,?> build, FilePath workspace, Launcher launcher, TaskListener listener) throws IOException, InterruptedException {
if (build instanceof AbstractBuild && Util.isOverridden(SCM.class, getClass(), "calcRevisionsFromBuild", AbstractBuild.class, Launcher.class, TaskListener.class)) {
@@ -370,6 +371,7 @@ public SCMRevisionState _calcRevisionsFromBuild(AbstractBuild<?, ?> build, Launc
* @throws InterruptedException
* interruption is usually caused by the user aborting the computation.
* this exception should be simply propagated all the way up.
* @since 1.568
*/
public PollingResult compareRemoteRevisionWith(Job<?,?> project, Launcher launcher, FilePath workspace, TaskListener listener, SCMRevisionState baseline) throws IOException, InterruptedException {
if (project instanceof AbstractProject && Util.isOverridden(SCM.class, getClass(), "compareRemoteRevisionWith", AbstractProject.class, Launcher.class, FilePath.class, TaskListener.class, SCMRevisionState.class)) {
@@ -445,6 +447,7 @@ private boolean is1_346OrLater() {
* interruption is usually caused by the user aborting the build.
* this exception will cause the build to be aborted.
* @throws AbortException in case of a routine failure
* @since 1.568
*/
public void checkout(Run<?,?> build, Launcher launcher, FilePath workspace, TaskListener listener, @CheckForNull File changelogFile) throws IOException, InterruptedException {
if (build instanceof AbstractBuild && listener instanceof BuildListener && Util.isOverridden(SCM.class, getClass(), "checkout", AbstractBuild.class, Launcher.class, FilePath.class, BuildListener.class, File.class)) {
@@ -475,7 +478,7 @@ public boolean checkout(AbstractBuild<?,?> build, Launcher launcher, FilePath wo

/**
* Get a chance to do operations after the workspace i checked out and the changelog is written.
* @since 1.534, 1.532.1
* @since 1.568
*/
public void postCheckout(Run<?,?> build, Launcher launcher, FilePath workspace, TaskListener listener) throws IOException, InterruptedException {
if (build instanceof AbstractBuild && listener instanceof BuildListener) {
@@ -653,6 +656,9 @@ protected final boolean createEmptyChangeLog(File changelogFile, BuildListener l
}
}

/**
* @since 1.568
*/
protected final void createEmptyChangeLog(File changelogFile, TaskListener listener, String rootTag) throws IOException {
FileWriter w = null;
try {
@@ -686,6 +692,7 @@ protected final String nullify(String s) {

/**
* Returns the list of {@link SCMDescriptor}s that are applicable to the given project.
* @since 1.568
*/
public static List<SCMDescriptor<?>> _for(final Job project) {
if(project==null) return all();
@@ -715,7 +722,7 @@ protected final String nullify(String s) {
* Try to guess how a repository browser should be configured, based on URLs and the like.
* Used when {@link #getBrowser} has not been explicitly configured.
* @return a reasonable default value for {@link #getEffectiveBrowser}, or null
* @since TODO
* @since 1.568
*/
public @CheckForNull RepositoryBrowser<?> guessBrowser() {
return null;
@@ -114,7 +114,7 @@ public boolean isBrowserReusable(T x, T y) {
* When this method returns false, this {@link SCM} will not appear in the configuration screen
* for the given project. The default is true for {@link AbstractProject} but false for {@link Job}.
*
* @since 1.294
* @since 1.568
*/
public boolean isApplicable(Job project) {
if (project instanceof AbstractProject) {
@@ -321,6 +321,9 @@ public boolean isActivated() {
@Deprecated
public transient /*final*/ AbstractBuild build;

/**
* @since 1.568
*/
public BuildAction(Run<?,?> run) {
this.run = run;
build = run instanceof AbstractBuild ? (AbstractBuild) run : null;
@@ -331,6 +334,9 @@ public BuildAction(AbstractBuild build) {
this((Run) build);
}

/**
* @since 1.568
*/
public Run<?,?> getRun() {
return run;
}
@@ -399,6 +405,9 @@ public void writePollingLogTo(long offset, XMLOutput out) throws IOException {
return item instanceof AbstractProject ? ((AbstractProject) item) : null;
}

/**
* @since 1.568
*/
public Item getItem() {
return job().asItem();
}
@@ -467,6 +476,7 @@ public File getLogFile() {

/**
* For which {@link Item} are we polling?
* @since 1.568
*/
public SCMTriggerItem getTarget() {
return job();
@@ -43,7 +43,7 @@

/**
* The item type accepted by {@link SCMTrigger}.
* @since TODO
* @since 1.568
*/
public interface SCMTriggerItem {

@@ -86,7 +86,6 @@
* See whether an item can be coerced to {@link SCMTriggerItem}.
* @param item any item
* @return itself, if a {@link SCMTriggerItem}, or an adapter, if an {@link hudson.model.SCMedItem}, else null
* @since TODO
*/
@SuppressWarnings("deprecation")
public static @CheckForNull SCMTriggerItem asSCMTriggerItem(Item item) {

0 comments on commit 7423d30

Please sign in to comment.
You can’t perform that action at this time.