Skip to content
Permalink
Browse files

Merge pull request #22 from nimeacuerdo/fix-multiple-revisions-per-bu…

…ild-issue

[FIXED JENKINS-12829] A failed update sets revision of build to 000000+
  • Loading branch information...
Jesse Glick
Jesse Glick committed May 7, 2012
2 parents 99d221c + 84205ec commit a7483f9809464854c6af2d01db7ab6aab1c98461
@@ -610,7 +610,9 @@ private void clone(AbstractBuild<?,?> build, Launcher launcher, FilePath reposit
ArgumentListBuilder upArgs = new ArgumentListBuilder();
upArgs.add("update");
upArgs.add("--rev", getBranch(env));
hg.run(upArgs).pwd(repository).join();
if (hg.run(upArgs).pwd(repository).join() != 0) {
throw new AbortException("Failed to update " + source + " to rev " + getBranch(env));
}

String tip = hg.tip(repository, null);
String rev = hg.tipNumber(repository, null);
@@ -3,6 +3,7 @@
import hudson.Launcher;
import hudson.Proc;
import hudson.model.AbstractBuild;
import hudson.model.Action;
import hudson.model.Cause.UserCause;
import hudson.model.FreeStyleBuild;
import hudson.model.FreeStyleProject;
@@ -581,6 +582,22 @@ public void testTrailingUrlWhitespace() throws Exception {
AbstractBuild<?, ?> b = p.scheduleBuild2(0).get();
assertEquals(Result.SUCCESS, b.getResult());
}

@Bug(12829)
public void testNonExistingBranchesDontGenerateMercurialTagActionsInTheBuild() throws Exception {
AbstractBuild<?, ?> b;
FreeStyleProject p = createFreeStyleProject();
p.setScm(new MercurialSCM(hgInstallation, repo.getPath(), "non-existing-branch", null,
null, null, false));
hg(repo, "init");
touchAndCommit(repo, "dir1/f1");
b = p.scheduleBuild2(0).get();
for (Action action : b.getActions()) {
if (action instanceof MercurialTagAction) {
fail("There should not be any MercurialTagAction");
}
}
}

private PretendSlave createNoopPretendSlave() throws Exception {
return createPretendSlave(new NoopFakeLauncher());

0 comments on commit a7483f9

Please sign in to comment.
You can’t perform that action at this time.