use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.
the class AbstractExportCommand method executeCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
ScmVersion scmVersion = parameters.getScmVersion(CommandParameter.SCM_VERSION, null);
String outputDirectory = parameters.getString(CommandParameter.OUTPUT_DIRECTORY, null);
return executeExportCommand(repository, fileSet, scmVersion, outputDirectory);
}
use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.
the class GitChangeLogCommand 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 AbstractScmProvider method changeLog.
/**
* {@inheritDoc}
*
* @deprecated
*/
public ChangeLogScmResult changeLog(ScmRepository repository, ScmFileSet fileSet, String startTag, String endTag, String datePattern) throws ScmException {
ScmVersion startRevision = null;
ScmVersion endRevision = null;
if (StringUtils.isNotEmpty(startTag)) {
startRevision = new ScmRevision(startTag);
}
if (StringUtils.isNotEmpty(endTag)) {
endRevision = new ScmRevision(endTag);
}
return changeLog(repository, fileSet, startRevision, endRevision, null);
}
use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.
the class AbstractUpdateCommand method executeCommand.
/**
* {@inheritDoc}
*/
public ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
ScmVersion scmVersion = parameters.getScmVersion(CommandParameter.SCM_VERSION, null);
boolean runChangelog = Boolean.valueOf(parameters.getString(CommandParameter.RUN_CHANGELOG_WITH_UPDATE, "true")).booleanValue();
UpdateScmResult updateScmResult = executeUpdateCommand(repository, fileSet, scmVersion);
List<ScmFile> filesList = updateScmResult.getUpdatedFiles();
if (!runChangelog) {
return updateScmResult;
}
ChangeLogCommand changeLogCmd = getChangeLogCommand();
if (filesList != null && filesList.size() > 0 && changeLogCmd != null) {
ChangeLogScmResult changeLogScmResult = (ChangeLogScmResult) changeLogCmd.executeCommand(repository, fileSet, parameters);
List<ChangeSet> changes = new ArrayList<ChangeSet>();
ChangeLogSet changeLogSet = changeLogScmResult.getChangeLog();
if (changeLogSet != null) {
Date startDate = null;
try {
startDate = parameters.getDate(CommandParameter.START_DATE);
} catch (ScmException e) {
// Do nothing, startDate isn't define.
}
for (ChangeSet change : changeLogSet.getChangeSets()) {
if (startDate != null && change.getDate() != null) {
if (startDate.after(change.getDate())) {
continue;
}
}
for (ScmFile currentFile : filesList) {
if (change.containsFilename(currentFile.getPath())) {
changes.add(change);
break;
}
}
}
}
updateScmResult.setChanges(changes);
}
return updateScmResult;
}
use of org.apache.maven.scm.ScmVersion in project maven-scm by apache.
the class AbstractListCommand method executeCommand.
/**
* {@inheritDoc}
*/
public ScmResult executeCommand(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
if (fileSet.getFileList().isEmpty()) {
throw new IllegalArgumentException("fileSet can not be empty");
}
boolean recursive = parameters.getBoolean(CommandParameter.RECURSIVE);
ScmVersion scmVersion = parameters.getScmVersion(CommandParameter.SCM_VERSION, null);
return executeListCommand(repository, fileSet, recursive, scmVersion);
}
Aggregations