use of org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand in project maven-scm by apache.
the class JazzScmProvider method add.
/**
* {@inheritDoc}
*/
public AddScmResult add(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
getLogger().debug("JazzScmProvider:add()");
JazzAddCommand command = new JazzAddCommand();
command.setLogger(getLogger());
return (AddScmResult) command.execute(repository, fileSet, parameters);
}
use of org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand in project maven-scm by apache.
the class JazzCheckInCommand method executeCheckInCommand.
protected CheckInScmResult executeCheckInCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion scmVersion) throws ScmException {
// Call the Add command to perform the checkin into the repository workspace.
JazzAddCommand addCommand = new JazzAddCommand();
addCommand.setLogger(getLogger());
AddScmResult addResult = addCommand.executeAddCommand(repo, fileSet);
// Now, if it has a flow target, deliver it.
JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
if (jazzRepo.isPushChangesAndHaveFlowTargets()) {
// Push if we need too
JazzScmCommand deliverCmd = createDeliverCommand((JazzScmProviderRepository) repo, fileSet);
StreamConsumer deliverConsumer = // No need for a dedicated consumer for this
new DebugLoggerConsumer(getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
int status = deliverCmd.execute(deliverConsumer, errConsumer);
if (status != 0) {
return new CheckInScmResult(deliverCmd.getCommandString(), "Error code for Jazz SCM deliver command - " + status, errConsumer.getOutput(), false);
}
}
// Return what was added.
return new CheckInScmResult(addResult.getCommandLine(), addResult.getAddedFiles());
}
Aggregations