Search in sources :

Example 16 with ScmVersion

use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.

the class AbstractCheckOutCommand method executeCommand.

/**
 * {@inheritDoc}
 */
public ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    ScmVersion scmVersion = parameters.getScmVersion(CommandParameter.SCM_VERSION, null);
    boolean recursive = parameters.getBoolean(CommandParameter.RECURSIVE, true);
    boolean shallow = parameters.getBoolean(CommandParameter.SHALLOW, false);
    return executeCheckOutCommand(repository, fileSet, scmVersion, recursive, shallow);
}
Also used : ScmVersion(org.apache.maven.scm.ScmVersion)

Example 17 with ScmVersion

use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.

the class BazaarChangeLogCommand method executeChangeLogCommand.

/**
 * {@inheritDoc}
 */
@Override
protected ChangeLogScmResult executeChangeLogCommand(ChangeLogScmRequest request) throws ScmException {
    final ScmVersion startVersion = request.getStartRevision();
    final ScmVersion endVersion = request.getEndRevision();
    final ScmFileSet fileSet = request.getScmFileSet();
    final String datePattern = request.getDatePattern();
    if (startVersion != null || endVersion != null) {
        final ScmProviderRepository scmProviderRepository = request.getScmRepository().getProviderRepository();
        return executeChangeLogCommand(scmProviderRepository, fileSet, startVersion, endVersion, datePattern);
    }
    return executeChangeLogCommand(fileSet, request.getStartDate(), request.getEndDate(), datePattern, request.getLimit());
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmProviderRepository(org.apache.maven.scm.provider.ScmProviderRepository) ScmVersion(org.apache.maven.scm.ScmVersion)

Example 18 with ScmVersion

use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.

the class SvnChangeLogCommand method executeChangeLogCommand.

@Override
protected ChangeLogScmResult executeChangeLogCommand(ChangeLogScmRequest request) throws ScmException {
    final ScmVersion startVersion = request.getStartRevision();
    final ScmVersion endVersion = request.getEndRevision();
    final ScmFileSet fileSet = request.getScmFileSet();
    final String datePattern = request.getDatePattern();
    return executeChangeLogCommand(request.getScmRepository().getProviderRepository(), fileSet, request.getStartDate(), request.getEndDate(), request.getScmBranch(), datePattern, startVersion, endVersion, request.getLimit());
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) ScmVersion(org.apache.maven.scm.ScmVersion)

Example 19 with ScmVersion

use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.

the class AccuRevUpdateCommand method executeAccurevCommand.

@Override
protected ScmResult executeAccurevCommand(AccuRevScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException, AccuRevException {
    AccuRev accuRev = repository.getAccuRev();
    File basedir = fileSet.getBasedir();
    AccuRevInfo info = accuRev.info(basedir);
    if (!info.isWorkSpace()) {
        throw new AccuRevException("No workspace at " + basedir.getAbsolutePath());
    }
    String startRevision = getStartRevision(repository, parameters, info);
    ScmVersion scmVersion = parameters.getScmVersion(CommandParameter.SCM_VERSION, null);
    String updateTransactionId = null;
    if (scmVersion != null) {
        AccuRevVersion updateVersion = repository.getAccuRevVersion(scmVersion);
        // Reparent if necessary
        String newBasisStream = updateVersion.getBasisStream();
        if (newBasisStream != null && (!(newBasisStream.equals(info.getWorkSpace()) || newBasisStream.equals(info.getBasis())))) {
            getLogger().info("Reparenting " + info.getWorkSpace() + " to " + newBasisStream);
            accuRev.chws(basedir, info.getWorkSpace(), newBasisStream);
        }
        if (!updateVersion.isNow()) {
            updateTransactionId = updateVersion.getTimeSpec();
        }
    }
    if (updateTransactionId == null) {
        updateTransactionId = repository.getDepotTransactionId(info.getWorkSpace(), "now");
    }
    String endRevision = repository.getRevision(info.getWorkSpace(), updateTransactionId);
    List<File> updatedFiles = accuRev.update(basedir, updateTransactionId);
    if (updatedFiles != null) {
        return new AccuRevUpdateScmResult(accuRev.getCommandLines(), getScmFiles(updatedFiles, ScmFileStatus.UPDATED), startRevision, endRevision);
    } else {
        return new AccuRevUpdateScmResult(accuRev.getCommandLines(), "AccuRev error", accuRev.getErrorOutput(), null, null, false);
    }
}
Also used : AccuRev(org.apache.maven.scm.provider.accurev.AccuRev) AccuRevException(org.apache.maven.scm.provider.accurev.AccuRevException) AccuRevVersion(org.apache.maven.scm.provider.accurev.AccuRevVersion) File(java.io.File) AccuRevInfo(org.apache.maven.scm.provider.accurev.AccuRevInfo) ScmVersion(org.apache.maven.scm.ScmVersion)

Aggregations

ScmVersion (org.apache.maven.scm.ScmVersion)19 ScmException (org.apache.maven.scm.ScmException)6 ScmBranch (org.apache.maven.scm.ScmBranch)4 ScmFileSet (org.apache.maven.scm.ScmFileSet)4 ScmRevision (org.apache.maven.scm.ScmRevision)4 File (java.io.File)3 Date (java.util.Date)3 ScmFile (org.apache.maven.scm.ScmFile)3 ChangeLogScmResult (org.apache.maven.scm.command.changelog.ChangeLogScmResult)3 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)3 AccuRevVersion (org.apache.maven.scm.provider.accurev.AccuRevVersion)3 IOException (java.io.IOException)2 ChangeSet (org.apache.maven.scm.ChangeSet)2 ScmProviderRepository (org.apache.maven.scm.provider.ScmProviderRepository)2 AccuRev (org.apache.maven.scm.provider.accurev.AccuRev)2 AccuRevException (org.apache.maven.scm.provider.accurev.AccuRevException)2 SimpleDateFormat (java.text.SimpleDateFormat)1 ArrayList (java.util.ArrayList)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 ScmTag (org.apache.maven.scm.ScmTag)1