Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #12 from vernyquartara/JENKINS-22850
[FIXED JENKINS-22850] [FIXED JENKINS-6851] Added option on "Automatic Rebase" action to fail the build when merge conflicts are found.
  • Loading branch information
hugueschabot committed May 5, 2014
2 parents 368a057 + f1058d1 commit ca285ed
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/main/java/jenkins/plugins/svnmerge/RebaseBuilder.java
Expand Up @@ -22,16 +22,22 @@ public class RebaseBuilder extends Builder {
* {@link Permalink#getId() id} of the permalink to rebase with.
*/
public final String permalink;
/**
* Indicates whether to stop the build if the merge fails.
*/
public final boolean stopBuildIfMergeFails;

@DataBoundConstructor
public RebaseBuilder(String permalink) {
public RebaseBuilder(String permalink, boolean stopBuildIfMergeFails) {
this.permalink = permalink;
this.stopBuildIfMergeFails = stopBuildIfMergeFails;
}

@Override
public boolean perform(AbstractBuild<?, ?> build, Launcher launcher, BuildListener listener) throws InterruptedException, IOException {
new RebaseAction(build.getProject()).perform(listener,new RebaseSetting(permalink));
return true;
RebaseAction rebaseAction = new RebaseAction(build.getProject());
long result = rebaseAction.perform(listener,new RebaseSetting(permalink));
return !stopBuildIfMergeFails || result >= 0;
}

@Extension
Expand Down
Expand Up @@ -5,3 +5,6 @@ def f = namespace(FormTagLib.class)
f.entry(title:_("Build to rebase to"), field:"permalink") {
f.select()
}
f.entry(title:_("Stop the build if the merge fails"), field:"stopBuildIfMergeFails") {
f.checkbox()
}

0 comments on commit ca285ed

Please sign in to comment.