Skip to content

Commit

Permalink
[FIXED JENKINS-13080] don't update client view before flushing to 0 o…
Browse files Browse the repository at this point in the history
…n workspace deletion
  • Loading branch information
Rob Petti committed Apr 17, 2012
1 parent 121060f commit 13f9f49
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions src/main/java/hudson/plugins/perforce/PerforceSCM.java
Expand Up @@ -1362,11 +1362,16 @@ private PerforceTagAction getMostRecentTagAction(Run build) {
return getMostRecentTagAction(build.getPreviousBuild());
}

private Workspace getPerforceWorkspace(AbstractProject project, String projectPath,
private com.tek42.perforce.model.Workspace getPerforceWorkspace(AbstractProject project, String projectPath,
Depot depot, Node buildNode, AbstractBuild build,
Launcher launcher, FilePath workspace, TaskListener listener, boolean dontChangeRoot)
throws IOException, InterruptedException, PerforceException
throws java.io.IOException, java.lang.InterruptedException, com.tek42.perforce.PerforceException
{

return getPerforceWorkspace(project, projectPath, depot, buildNode, build, launcher, workspace, listener, dontChangeRoot, updateView);
}

private Workspace getPerforceWorkspace(AbstractProject project, String projectPath, Depot depot, Node buildNode, AbstractBuild build, Launcher launcher, FilePath workspace, TaskListener listener, boolean dontChangeRoot, boolean updateView) throws IOException, InterruptedException, PerforceException {
PrintStream log = listener.getLogger();

// If we are building on a slave node, and each node is supposed to have
Expand Down Expand Up @@ -1437,12 +1442,12 @@ else if (dontRenameClient) {
// So provide 'reasonable' default values.
boolean isunix = true;
if (launcher!= null)
isunix=launcher.isUnix();
isunix=launcher.isUnix();

String localPath = unescapeP4String(p4workspace.getRoot());

if (workspace!=null)
localPath = getLocalPathName(workspace, isunix);
localPath = getLocalPathName(workspace, isunix);
else if (localPath.trim().equals(""))
localPath = project.getRootDir().getAbsolutePath();

Expand Down Expand Up @@ -2816,7 +2821,8 @@ public boolean processWorkspaceBeforeDeletion(AbstractProject<?,?> project, File
null,
workspace,
listener,
dontRenameClient);
true,
false);
flushWorkspaceTo0(depot, p4workspace, log);
} catch (Exception ex) {
Logger.getLogger(PerforceSCM.class.getName()).log(Level.SEVERE, null, ex);
Expand Down

0 comments on commit 13f9f49

Please sign in to comment.