use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.
the class TfsCheckOutCommandTest method testCommandline.
public void testCommandline() throws Exception {
TfsScmProviderRepository repo = getScmProviderRepository();
ScmRevision rev = new ScmRevision("revision");
String path = getScmFileSet().getBasedir().getAbsolutePath();
Commandline cmd = new TfsCheckOutCommand().createGetCommand(repo, getScmFileSet(), rev, true).getCommandline();
String expected = "tf get -login:user,password -recursive -force -version:Crevision " + path;
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.
the class JazzCheckOutCommandTest method testCreateJazzLoadCommand.
public void testCreateJazzLoadCommand() throws Exception {
ScmRevision rev = new ScmRevision("revision");
// TODO figure out what Jazz SCM does in terms of branch/tag/revision
// TODO figure out how/when to load specific files
Commandline cmd = new JazzCheckOutCommand().createJazzLoadCommand(repo, getScmFileSet(), rev).getCommandline();
String expected = "scm load --force --repository-uri https://localhost:9443/jazz --username myUserName --password myPassword --dir " + getScmFileSet().getBasedir().getAbsolutePath() + " \"Dave's Repository Workspace\"";
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.
the class SvnCheckOutCommand method createCommandLine.
/**
* Create SVN check out command line.
*
* @param repository not null
* @param workingDirectory not null
* @param version not null
* @param url not null
* @param recursive <code>true</code> if recursive check out is wanted, <code>false</code> otherwise.
* @return the SVN command line for the SVN check out.
* @since 1.1.1
*/
public static Commandline createCommandLine(SvnScmProviderRepository repository, File workingDirectory, ScmVersion version, String url, boolean recursive) {
Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine(workingDirectory.getParentFile(), repository);
cl.createArg().setValue("checkout");
// add non recursive option
if (!recursive) {
cl.createArg().setValue("-N");
}
if (version != null && StringUtils.isNotEmpty(version.getName())) {
if (version instanceof ScmRevision) {
cl.createArg().setValue("-r");
cl.createArg().setValue(version.getName());
}
}
cl.createArg().setValue(url);
cl.createArg().setValue(workingDirectory.getAbsolutePath());
return cl;
}
use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.
the class SvnListCommand method createCommandLine.
static Commandline createCommandLine(SvnScmProviderRepository repository, ScmFileSet fileSet, boolean recursive, ScmVersion version) {
Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine(TMP_DIR, repository);
cl.createArg().setValue("list");
if (recursive) {
cl.createArg().setValue("--recursive");
}
if (version != null && StringUtils.isNotEmpty(version.getName())) {
if (version instanceof ScmRevision) {
cl.createArg().setValue("-r");
cl.createArg().setValue(version.getName());
}
}
Iterator<File> it = fileSet.getFileList().iterator();
while (it.hasNext()) {
File file = it.next();
cl.createArg().setValue(repository.getUrl() + "/" + file.getPath().replace('\\', '/'));
}
return cl;
}
use of org.apache.maven.scm.ScmRevision in project maven-scm by apache.
the class SvnExeExportCommand method createCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
public static Commandline createCommandLine(SvnScmProviderRepository repository, File workingDirectory, ScmVersion version, String url, String outputSirectory) {
if (version != null && StringUtils.isEmpty(version.getName())) {
version = null;
}
Commandline cl = SvnCommandLineUtils.getBaseSvnCommandLine(workingDirectory, repository);
cl.createArg().setValue("export");
if (version != null && StringUtils.isNotEmpty(version.getName())) {
if (version instanceof ScmRevision) {
cl.createArg().setValue("-r");
cl.createArg().setValue(version.getName());
}
}
// support exporting to an existing directory
cl.createArg().setValue("--force");
cl.createArg().setValue(url);
if (StringUtils.isNotEmpty(outputSirectory)) {
cl.createArg().setValue(outputSirectory);
}
return cl;
}
Aggregations