提交 cf45c6a8 编写于 作者: J Jesse Glick

Another case where RunAction2 is needed: SCM tag actions.

上级 64523255
......@@ -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;
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册