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);
}
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());
}
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());
}
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);
}
}
Aggregations