use of org.apache.maven.scm.ScmBranchParameters in project maven-scm by apache.
the class SvnExeBranchCommandTckTest method testBranchUserNameSvnHttpsRemoteBranchingWithRev.
// --no-auth-cache
public void testBranchUserNameSvnHttpsRemoteBranchingWithRev() throws Exception {
File messageFile = File.createTempFile("maven-scm", "commit");
messageFile.deleteOnExit();
ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
scmBranchParameters.setRemoteBranching(true);
scmBranchParameters.setScmRevision("2");
testCommandLine("scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --no-auth-cache --non-interactive copy --parents --file " + messageFile.getAbsolutePath() + " --revision 2 https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch", scmBranchParameters);
}
use of org.apache.maven.scm.ScmBranchParameters in project maven-scm by apache.
the class SvnBranchCommand method createCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
public static Commandline createCommandLine(SvnScmProviderRepository repository, File workingDirectory, String branch, File messageFile) {
ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
scmBranchParameters.setRemoteBranching(false);
return createCommandLine(repository, workingDirectory, branch, messageFile, scmBranchParameters);
}
use of org.apache.maven.scm.ScmBranchParameters in project maven-scm by apache.
the class BranchMojo method execute.
/**
* {@inheritDoc}
*/
public void execute() throws MojoExecutionException {
super.execute();
try {
ScmRepository repository = getScmRepository();
ScmProvider provider = getScmManager().getProviderByRepository(repository);
String finalBranch = provider.sanitizeTagName(branch);
getLog().info("Final Branch Name: '" + finalBranch + "'");
ScmBranchParameters scmBranchParameters = new ScmBranchParameters(message);
scmBranchParameters.setRemoteBranching(remoteBranching);
BranchScmResult result = provider.branch(repository, getFileSet(), finalBranch, scmBranchParameters);
checkResult(result);
} catch (IOException e) {
throw new MojoExecutionException("Cannot run branch command : ", e);
} catch (ScmException e) {
throw new MojoExecutionException("Cannot run branch command : ", e);
}
}
use of org.apache.maven.scm.ScmBranchParameters in project maven-scm by apache.
the class AbstractBranchCommand method executeCommand.
/**
* {@inheritDoc}
*/
public ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
String branchName = parameters.getString(CommandParameter.BRANCH_NAME);
ScmBranchParameters scmBranchParameters = parameters.getScmBranchParameters(CommandParameter.SCM_BRANCH_PARAMETERS);
String message = parameters.getString(CommandParameter.MESSAGE, "[maven-scm] copy for branch " + branchName);
if (StringUtils.isBlank(scmBranchParameters.getMessage()) && StringUtils.isNotBlank(message)) {
scmBranchParameters.setMessage(message);
}
return executeBranchCommand(repository, fileSet, branchName, scmBranchParameters);
}
use of org.apache.maven.scm.ScmBranchParameters in project maven-scm by apache.
the class SvnExeBranchCommandTckTest method testBranchUserNameSvnHttpsRemoteBranchingNoRev.
public void testBranchUserNameSvnHttpsRemoteBranchingNoRev() throws Exception {
File messageFile = File.createTempFile("maven-scm", "commit");
messageFile.deleteOnExit();
ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
scmBranchParameters.setRemoteBranching(true);
testCommandLine("scm:svn:https://foo.com/svn/trunk", "svnbranch", messageFile, "user", "svn --username user --no-auth-cache --non-interactive copy --parents --file " + messageFile.getAbsolutePath() + " https://foo.com/svn/trunk https://foo.com/svn/branches/svnbranch", scmBranchParameters);
}
Aggregations