use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class ClearCaseCheckOutCommandTest method testUpdateConfigSpec.
public void testUpdateConfigSpec() throws Exception {
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_DEFAULT);
File configSpecLocation;
if (Os.isFamily("windows")) {
configSpecLocation = new File("\\\\myserver\\configspecs\\testconfigspec.txt");
} else {
configSpecLocation = new File("/clearcase/configspecs/testconfigspec.txt");
}
Commandline commandLine = checkOutCommand.createUpdateConfigSpecCommandLine(getWorkingDirectory(), configSpecLocation, "testView");
assertCommandLine("cleartool setcs -tag testView " + configSpecLocation, getWorkingDirectory(), commandLine);
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_LT);
commandLine = checkOutCommand.createUpdateConfigSpecCommandLine(getWorkingDirectory(), configSpecLocation, "testView");
assertCommandLine("cleartool setcs -tag testView " + configSpecLocation, getWorkingDirectory(), commandLine);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class ClearCaseCheckOutCommandTest method testCreateViewCommandLine.
public void testCreateViewCommandLine() throws IOException {
String viewName = "testView";
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_DEFAULT);
Commandline commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, null);
assertCommandLine("cleartool mkview -snapshot -tag testView -vws " + checkOutCommand.getViewStore() + "testView.vws " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
settings.setUseVWSParameter(false);
commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, null);
assertCommandLine("cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_LT);
settings.setUseVWSParameter(true);
commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, null);
assertCommandLine("cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
settings.setUseVWSParameter(false);
commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, null);
assertCommandLine("cleartool mkview -snapshot -tag testView " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
settings.setClearcaseType(ClearCaseScmProviderRepository.CLEARCASE_UCM);
String streamId = "streamIdentifier";
commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, streamId);
assertCommandLine("cleartool mkview -snapshot -tag testView -stream " + streamId + " " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
settings.setUseVWSParameter(true);
commandLine = checkOutCommand.createCreateViewCommandLine(getWorkingDirectory(), viewName, streamId);
assertCommandLine("cleartool mkview -snapshot -tag testView -stream " + streamId + " -vws " + checkOutCommand.getViewStore() + "testView.vws " + getWorkingDirectory().getCanonicalPath(), getWorkingDirectory().getParentFile(), commandLine);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AbstractCvsStatusCommand method executeStatusCommand.
/**
* {@inheritDoc}
*/
protected StatusScmResult executeStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand("update", repository, fileSet, "-n");
cl.createArg().setValue("-d");
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
return executeCvsCommand(cl);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AbstractCvsTagCommand method executeTagCommand.
/**
* {@inheritDoc}
*/
public ScmResult executeTagCommand(ScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters) throws ScmException {
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand("tag", repository, fileSet, false);
Settings settings = CvsUtil.getSettings();
if (settings.isUseForceTag()) {
cl.createArg().setValue("-F");
}
cl.createArg().setValue("-c");
cl.createArg().setValue(tag);
if (fileSet.getFileList() != null && !fileSet.getFileList().isEmpty()) {
for (Iterator<File> it = fileSet.getFileList().iterator(); it.hasNext(); ) {
File fileName = it.next();
cl.createArg().setValue(fileName.toString());
}
}
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
return executeCvsCommand(cl);
}
use of org.codehaus.plexus.util.cli.Commandline in project maven-scm by apache.
the class AbstractCvsUpdateCommand method executeUpdateCommand.
/**
* {@inheritDoc}
*/
public UpdateScmResult executeUpdateCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version) throws ScmException {
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand("update", repository, fileSet, false);
cl.createArg().setValue("-d");
if (version != null && StringUtils.isNotEmpty(version.getName())) {
cl.createArg().setValue("-r" + version.getName());
}
List<File> files = fileSet.getFileList();
if (!files.isEmpty()) {
Iterator<File> fileIterator = files.iterator();
while (fileIterator.hasNext()) {
cl.createArg().setValue(((File) fileIterator.next()).getPath());
}
}
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
return executeCvsCommand(cl);
}
Aggregations