Skip to content

Commit

Permalink
Merge pull request #50 from blt04/fix-shared-working-copy-update
Browse files Browse the repository at this point in the history
[FIXED JENKINS-15829] Don't recreate workspace when using Repository Sharing
  • Loading branch information
jglick committed Feb 12, 2014
2 parents 182c495 + 3173ad4 commit a1839d8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/main/java/hudson/plugins/mercurial/MercurialSCM.java
Expand Up @@ -484,15 +484,18 @@ private boolean canReuseWorkspace(FilePath repo,
boolean jobShouldUseSharing, AbstractBuild<?,?> build,
Launcher launcher, BuildListener listener)
throws IOException, InterruptedException {
if (!new FilePath(repo, ".hg/hgrc").exists()) {
return false;
}

boolean jobUsesSharing = new FilePath(repo, ".hg/sharedpath").exists();
if (jobShouldUseSharing != jobUsesSharing) {
return false;
} else if(jobUsesSharing) {
return true;
}

if (!new FilePath(repo, ".hg/hgrc").exists()) {
return false;
}

HgExe hg = new HgExe(findInstallation(getInstallation()), getCredentials(build.getProject()), launcher, build.getBuiltOn(), listener, build.getEnvironment(listener));
try {
String upstream = hg.config(repo, "paths.default");
Expand Down

0 comments on commit a1839d8

Please sign in to comment.