[FIXED HUDSON-3087] Purging workspace in Matrix job should purge all configuration workspaces, too. In 1.316.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@19589 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2009-07-10 17:37:06 +00:00
1 parent 6d3ed4c1f4
commit 029f6715f4
3 files changed
+25 -11

No files matched your search

@@ -78,6 +78,7 @@ import net.sf.json.JSONObject;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.HttpResponse;
/**
* {@link Job} that allows you to run multiple different configurations
@@ -542,6 +543,17 @@ public class MatrixProject extends AbstractProject<MatrixProject,MatrixBuild> im
rebuildConfigurations();
}
/**
* Also delete all the workspaces of the configuration, too.
*/
@Override
public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException {
HttpResponse rsp = super.doDoWipeOutWorkspace();
for (MatrixConfiguration c : configurations.values())
c.doDoWipeOutWorkspace();
return rsp;
}
public DescriptorImpl getDescriptor() {
return DESCRIPTOR;
}
@@ -61,6 +61,9 @@ import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.export.Exported;
import org.kohsuke.stapler.QueryParameter;
import org.kohsuke.stapler.HttpResponse;
import org.kohsuke.stapler.HttpRedirect;
import org.kohsuke.stapler.ForwardToView;
import javax.servlet.ServletException;
@@ -1251,29 +1254,28 @@ public abstract class AbstractProject<P extends AbstractProject<P,R>,R extends A
/**
* Wipes out the workspace.
*/
public void doDoWipeOutWorkspace(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException {
public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException {
checkPermission(BUILD);
if (getScm().processWorkspaceBeforeDeletion(this, getWorkspace(), null)) {
getWorkspace().deleteRecursive();
rsp.sendRedirect2(".");
}
// If we get here, that means the SCM blocked the workspace deletion.
else {
req.getView(this, "wipeOutWorkspaceBlocked.jelly").forward(req, rsp);
return new HttpRedirect(".");
} else {
// If we get here, that means the SCM blocked the workspace deletion.
return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly");
}
}
public void doDisable(StaplerResponse rsp) throws IOException, ServletException {
public HttpResponse doDisable() throws IOException, ServletException {
requirePOST();
checkPermission(CONFIGURE);
makeDisabled(true);
rsp.sendRedirect2(".");
return new HttpRedirect(".");
}
public void doEnable(StaplerResponse rsp) throws IOException, ServletException {
public HttpResponse doEnable() throws IOException, ServletException {
checkPermission(CONFIGURE);
makeDisabled(false);
rsp.sendRedirect2(".");
return new HttpRedirect(".");
}
/**