use of org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository 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.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository 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.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository 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);
}
use of org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository in project maven-scm by apache.
the class AbstractCvsAddCommand method executeAddCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeAddCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message, boolean binary) throws ScmException {
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand("add", repository, fileSet);
if (binary) {
cl.createArg().setValue("-kb");
}
if (message != null && message.length() > 0) {
cl.createArg().setValue("-m");
cl.createArg().setValue("\"" + message + "\"");
}
List<ScmFile> addedFiles = new ArrayList<ScmFile>(fileSet.getFileList().size());
for (File file : fileSet.getFileList()) {
String path = file.getPath().replace('\\', '/');
cl.createArg().setValue(path);
addedFiles.add(new ScmFile(path, ScmFileStatus.ADDED));
}
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
return executeCvsCommand(cl, addedFiles);
}
use of org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository in project maven-scm by apache.
the class AbstractCvsBlameCommand method executeBlameCommand.
/**
* {@inheritDoc}
*/
public BlameScmResult executeBlameCommand(ScmProviderRepository repo, ScmFileSet fileSet, String filename) throws ScmException {
CvsScmProviderRepository repository = (CvsScmProviderRepository) repo;
Commandline cl = CvsCommandUtils.getBaseCommand("annotate", repository, fileSet);
cl.createArg().setValue(filename);
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
return executeCvsCommand(cl, repository);
}
Aggregations