Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #4 from ain322/JENKINS-11379
[FIXED JENKINS-11379] add original localDir to new ModuleLocation
  • Loading branch information
hugueschabot committed Feb 16, 2014
2 parents f2b6945 + 3918069 commit 23619da
Showing 1 changed file with 4 additions and 3 deletions.
Expand Up @@ -99,7 +99,8 @@ public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter

// TODO: check for multiple locations
SubversionSCM svn = (SubversionSCM) scm;
String url = svn.getLocations()[0].getURL();
ModuleLocation firstLocation = svn.getLocations()[0];
String url = firstLocation.getURL();
Matcher m = KEYWORD.matcher(url);
if(!m.find()) {
sendError("Unable to infer the new branch name from "+url);
Expand Down Expand Up @@ -129,7 +130,7 @@ public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter

// create a branch
svnm.getCopyClient().doCopy(
svn.getLocations()[0].getSVNURL(), SVNRevision.HEAD,
firstLocation.getSVNURL(), SVNRevision.HEAD,
dst, false, true,
commitMessage);
} catch (SVNException e) {
Expand All @@ -148,7 +149,7 @@ public void doNewBranch(StaplerRequest req, StaplerResponse rsp, @QueryParameter
SubversionSCM svnScm = (SubversionSCM)copy.getScm();
copy.setScm(
new SubversionSCM(
Arrays.asList(new ModuleLocation(url,null)),
Arrays.asList(new ModuleLocation(url,firstLocation.getLocalDir())),
svnScm.getWorkspaceUpdater(), svnScm.getBrowser(),
svnScm.getExcludedRegions(),
svnScm.getExcludedUsers(),
Expand Down

0 comments on commit 23619da

Please sign in to comment.