mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 05:22:22 +00:00
Another case where RunAction2 is needed: SCM tag actions.
This commit is contained in:
1 parent
645232557a
commit
cf45c6a8f2
1 file changed
+12
-2
@@ -26,6 +26,7 @@ package hudson.scm;
|
||||
import hudson.model.AbstractBuild;
|
||||
import hudson.model.TaskAction;
|
||||
import hudson.model.BuildBadgeAction;
|
||||
import hudson.model.Run;
|
||||
import hudson.security.Permission;
|
||||
import hudson.security.ACL;
|
||||
import org.kohsuke.stapler.StaplerRequest;
|
||||
@@ -33,6 +34,7 @@ import org.kohsuke.stapler.StaplerResponse;
|
||||
|
||||
import javax.servlet.ServletException;
|
||||
import java.io.IOException;
|
||||
import jenkins.model.RunAction2;
|
||||
|
||||
/**
|
||||
* Common part of <tt>CVSSCM.TagAction</tt> and <tt>SubversionTagAction</tt>.
|
||||
@@ -44,8 +46,8 @@ import java.io.IOException;
|
||||
*
|
||||
* @author Kohsuke Kawaguchi
|
||||
*/
|
||||
public abstract class AbstractScmTagAction extends TaskAction implements BuildBadgeAction {
|
||||
protected final AbstractBuild build;
|
||||
public abstract class AbstractScmTagAction extends TaskAction implements BuildBadgeAction, RunAction2 {
|
||||
protected transient /*final*/ AbstractBuild build;
|
||||
|
||||
protected AbstractScmTagAction(AbstractBuild build) {
|
||||
this.build = build;
|
||||
@@ -93,4 +95,12 @@ public abstract class AbstractScmTagAction extends TaskAction implements BuildBa
|
||||
return "tagForm.jelly";
|
||||
}
|
||||
|
||||
@Override public void onAttached(Run<?, ?> r) {
|
||||
// unnecessary, constructor already does this
|
||||
}
|
||||
|
||||
@Override public void onLoad(Run<?, ?> r) {
|
||||
build = (AbstractBuild) r;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user