Skip to content

Commit

Permalink
Merge pull request #6 from clifford-github/master
Browse files Browse the repository at this point in the history
[FIXED JENKINS-11012] Added possibility to enter a commit message
  • Loading branch information
hugueschabot committed Feb 13, 2014
2 parents 159b0b1 + 9f42795 commit f2b6945
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Expand Up @@ -75,16 +75,22 @@ public List<AbstractProject<?,?>> getBranches() {
return r;
}

public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter boolean attach) throws ServletException, IOException {
public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter String name, @QueryParameter boolean attach, @QueryParameter String commitMessage) throws ServletException, IOException {
requirePOST();

name = Util.fixEmptyAndTrim(name);

if (name==null) {
sendError("Name is required");
return;
}

commitMessage = Util.fixEmptyAndTrim(commitMessage);

if (commitMessage==null) {
commitMessage = "Created a feature branch from Jenkins";
}

SCM scm = project.getScm();
if (!(scm instanceof SubversionSCM)) {
sendError("This project doesn't use Subversion as SCM");
Expand Down Expand Up @@ -125,7 +131,7 @@ public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter
svnm.getCopyClient().doCopy(
svn.getLocations()[0].getSVNURL(), SVNRevision.HEAD,
dst, false, true,
"Created a feature branch from Jenkins");
commitMessage);
} catch (SVNException e) {
sendError(e);
return;
Expand Down
Expand Up @@ -33,6 +33,10 @@ l.layout(norefresh:"true",title:_("title",my.project.displayName)) {
form (name:"new", method:"post", action:"newBranch") {
text(_("Branch Name")+":")
input (type:"text", name:"name", width:"30")
raw("</br>")
text(_("Commit Message")+":")
input (type:"text", name:"commitMessage")
raw("</br>")
f.submit(value:_("Create"))
}
}
Expand Down

0 comments on commit f2b6945

Please sign in to comment.