Search in sources :

Example 6 with JazzScmCommand

use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.

the class JazzTagCommand method createTagDeliverCommand.

// Create the JazzScmCommand to execute the "scm deliver ..." command
// This will deliver the changes to the flow target (stream or other workspace).
public JazzScmCommand createTagDeliverCommand(JazzScmProviderRepository repo, ScmFileSet fileSet, String tag) {
    JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_DELIVER, repo, fileSet, getLogger());
    if (repo.getWorkspace() != null && !repo.getWorkspace().equals("")) {
        // Don't deliver from the workspace, as it has the release.properties etc files in it
        // and jazz will choke on them, so use the workspace that we just created (tag) instead.
        command.addArgument(JazzConstants.ARG_DELIVER_SOURCE);
        command.addArgument(tag);
    }
    if (repo.getFlowTarget() != null && !repo.getFlowTarget().equals("")) {
        command.addArgument(JazzConstants.ARG_DELIVER_TARGET);
        command.addArgument(repo.getFlowTarget());
    }
    return command;
}
Also used : JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand)

Example 7 with JazzScmCommand

use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.

the class JazzUnEditCommand method createUneditCommand.

public JazzScmCommand createUneditCommand(ScmProviderRepository repo, ScmFileSet fileSet) {
    JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_LOCK, JazzConstants.CMD_SUB_RELEASE, repo, fileSet, getLogger());
    List<File> files = fileSet.getFileList();
    if (files != null && !files.isEmpty()) {
        for (File file : files) {
            // Un-Lock only the files specified
            command.addArgument(file.getPath());
        }
    } else {
        // Un-Lock all files
        command.addArgument(".");
    }
    return command;
}
Also used : JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) File(java.io.File)

Example 8 with JazzScmCommand

use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.

the class JazzUpdateCommand method createAcceptCommand.

public JazzScmCommand createAcceptCommand(ScmProviderRepository repo, ScmFileSet fileSet) {
    JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_ACCEPT, repo, fileSet, getLogger());
    command.addArgument(JazzConstants.ARG_FLOW_COMPONENTS);
    return command;
}
Also used : JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand)

Example 9 with JazzScmCommand

use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.

the class JazzUpdateCommand method executeUpdateCommand.

/**
 * {@inheritDoc}
 */
protected UpdateScmResult executeUpdateCommand(ScmProviderRepository repo, ScmFileSet fileSet, ScmVersion version) throws ScmException {
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("Executing update command...");
    }
    JazzUpdateConsumer updateConsumer = new JazzUpdateConsumer(repo, getLogger());
    ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
    JazzScmCommand updateCmd = createAcceptCommand(repo, fileSet);
    int status = updateCmd.execute(updateConsumer, errConsumer);
    if (status != 0) {
        return new UpdateScmResult(updateCmd.getCommandString(), "Error code for Jazz SCM update command - " + status, errConsumer.getOutput(), false);
    }
    if (getLogger().isDebugEnabled()) {
        if (!updateConsumer.getUpdatedFiles().isEmpty()) {
            getLogger().debug("Iterating over \"Update\" results");
            for (ScmFile file : updateConsumer.getUpdatedFiles()) {
                getLogger().debug(file.getPath() + " : " + file.getStatus());
            }
        } else {
            getLogger().debug("There are no updated files");
        }
    }
    // We can use the checkout directory for this.
    return new UpdateScmResult(updateCmd.getCommandString(), updateConsumer.getUpdatedFiles());
}
Also used : ErrorConsumer(org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer) UpdateScmResult(org.apache.maven.scm.command.update.UpdateScmResult) JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) ScmFile(org.apache.maven.scm.ScmFile)

Example 10 with JazzScmCommand

use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.

the class JazzCheckInCommand method createCreateChangesetCommand.

public JazzScmCommand createCreateChangesetCommand(ScmProviderRepository repo, ScmFileSet fileSet, String message) {
    JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_CREATE, JazzConstants.CMD_SUB_CHANGESET, repo, false, fileSet, getLogger());
    command.addArgument(message);
    return command;
}
Also used : JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand)

Aggregations

JazzScmCommand (org.apache.maven.scm.provider.jazz.command.JazzScmCommand)31 ErrorConsumer (org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer)13 File (java.io.File)7 JazzScmProviderRepository (org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)7 ScmFile (org.apache.maven.scm.ScmFile)6 DebugLoggerConsumer (org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)6 ArrayList (java.util.ArrayList)3 StatusScmResult (org.apache.maven.scm.command.status.StatusScmResult)3 JazzStatusCommand (org.apache.maven.scm.provider.jazz.command.status.JazzStatusCommand)3 ScmException (org.apache.maven.scm.ScmException)2 AddScmResult (org.apache.maven.scm.command.add.AddScmResult)2 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)2 StreamConsumer (org.codehaus.plexus.util.cli.StreamConsumer)2 HashMap (java.util.HashMap)1 ChangeSet (org.apache.maven.scm.ChangeSet)1 ScmBranch (org.apache.maven.scm.ScmBranch)1 ScmTag (org.apache.maven.scm.ScmTag)1 BlameScmResult (org.apache.maven.scm.command.blame.BlameScmResult)1 ChangeLogScmResult (org.apache.maven.scm.command.changelog.ChangeLogScmResult)1 ChangeLogSet (org.apache.maven.scm.command.changelog.ChangeLogSet)1