Search in sources :

Example 1 with JazzAddCommand

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);
}
Also used : AddScmResult(org.apache.maven.scm.command.add.AddScmResult) JazzAddCommand(org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand)

Example 2 with JazzAddCommand

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());
}
Also used : StreamConsumer(org.codehaus.plexus.util.cli.StreamConsumer) AddScmResult(org.apache.maven.scm.command.add.AddScmResult) ErrorConsumer(org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer) JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) JazzAddCommand(org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand) DebugLoggerConsumer(org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer) CheckInScmResult(org.apache.maven.scm.command.checkin.CheckInScmResult) JazzScmProviderRepository(org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)

Aggregations

AddScmResult (org.apache.maven.scm.command.add.AddScmResult)2 JazzAddCommand (org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand)2 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)1 JazzScmCommand (org.apache.maven.scm.provider.jazz.command.JazzScmCommand)1 DebugLoggerConsumer (org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)1 ErrorConsumer (org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer)1 JazzScmProviderRepository (org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)1 StreamConsumer (org.codehaus.plexus.util.cli.StreamConsumer)1