Search in sources :

Example 1 with CvsScmProviderRepository

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);
}
Also used : CvsScmProviderRepository(org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository) Commandline(org.codehaus.plexus.util.cli.Commandline)

Example 2 with CvsScmProviderRepository

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);
}
Also used : CvsScmProviderRepository(org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File) Settings(org.apache.maven.scm.providers.cvslib.settings.Settings)

Example 3 with CvsScmProviderRepository

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);
}
Also used : CvsScmProviderRepository(org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) File(java.io.File)

Example 4 with CvsScmProviderRepository

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);
}
Also used : CvsScmProviderRepository(org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository) Commandline(org.codehaus.plexus.util.cli.Commandline) ArrayList(java.util.ArrayList) ScmFile(org.apache.maven.scm.ScmFile) File(java.io.File) ScmFile(org.apache.maven.scm.ScmFile)

Example 5 with CvsScmProviderRepository

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);
}
Also used : CvsScmProviderRepository(org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository) Commandline(org.codehaus.plexus.util.cli.Commandline)

Aggregations

CvsScmProviderRepository (org.apache.maven.scm.provider.cvslib.repository.CvsScmProviderRepository)17 Commandline (org.codehaus.plexus.util.cli.Commandline)13 File (java.io.File)6 IOException (java.io.IOException)4 ScmException (org.apache.maven.scm.ScmException)3 ArrayList (java.util.ArrayList)2 ScmFile (org.apache.maven.scm.ScmFile)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ScmVersion (org.apache.maven.scm.ScmVersion)1 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)1 LoginScmResult (org.apache.maven.scm.command.login.LoginScmResult)1 SvnScmProviderRepository (org.apache.maven.scm.provider.svn.repository.SvnScmProviderRepository)1 Settings (org.apache.maven.scm.providers.cvslib.settings.Settings)1 ScmRepository (org.apache.maven.scm.repository.ScmRepository)1 ScmRepositoryException (org.apache.maven.scm.repository.ScmRepositoryException)1