Search in sources :

Example 16 with JazzScmProviderRepository

use of org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository in project maven-scm by apache.

the class JazzStatusConsumer method consumeLine.

/**
 * Process one line of output from the execution of the "scm status" command.
 *
 * @param line The line of output from the external command that has been pumped to us.
 * @see org.codehaus.plexus.util.cli.StreamConsumer#consumeLine(java.lang.String)
 */
public void consumeLine(String line) {
    super.consumeLine(line);
    if (containsWorkspace(line)) {
        extractWorkspace(line);
    }
    if (containsComponent(line)) {
        extractComponent(line);
    }
    if (containsBaseline(line)) {
        extractBaseline(line);
    }
    if (containsStatusFlag(line)) {
        extractChangedFile(line);
    }
    if (containsOutgoing(line)) {
        // Now looking for outgoing, not incoming
        seenOutgoingChangeSets = true;
        seenIncomingChangeSets = false;
    }
    if (containsIncoming(line)) {
        // Now looking for incoming, not outgoing
        seenOutgoingChangeSets = false;
        seenIncomingChangeSets = true;
    }
    if (containsBaselines(line)) {
        // Got to baselines, stop looking for all changesets
        seenOutgoingChangeSets = false;
        seenIncomingChangeSets = false;
    }
    if (seenOutgoingChangeSets) {
        Integer changeSetAlias = extractChangeSetAlias(line);
        if (changeSetAlias != null) {
            // We are now supporting multiple change sets, as this allows
            // us to cater for multiple changeset caused by previous failed
            // release attempts.
            // Our starting point should always be a clean slate of a workspace
            // or sandbox, however, if something fails, then we will have some
            // changesets already created, so we need to be able to deal with them effectively.
            JazzScmProviderRepository jazzRepository = (JazzScmProviderRepository) getRepository();
            jazzRepository.getOutgoingChangeSetAliases().add(new Integer(changeSetAlias));
        }
    }
    if (seenIncomingChangeSets) {
        Integer changeSetAlias = extractChangeSetAlias(line);
        if (changeSetAlias != null) {
            // We are now supporting multiple change sets, as this allows
            // us to cater for multiple changeset caused by previous failed
            // release attempts.
            // Our starting point should always be a clean slate of a workspace
            // or sandbox, however, if something fails, then we will have some
            // changesets already created, so we need to be able to deal with them effectively.
            JazzScmProviderRepository jazzRepository = (JazzScmProviderRepository) getRepository();
            jazzRepository.getIncomingChangeSetAliases().add(new Integer(changeSetAlias));
        }
    }
}
Also used : JazzScmProviderRepository(org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)

Example 17 with JazzScmProviderRepository

use of org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository in project maven-scm by apache.

the class JazzCheckInCommandTest method testCreateCheckInCommandCheckingInSpecificFiles.

public void testCreateCheckInCommandCheckingInSpecificFiles() throws Exception {
    JazzScmProviderRepository repo = getScmProviderRepository();
    Commandline cmd = new JazzCheckInCommand().createCheckInCommand(repo, getScmFileSet()).getCommandline();
    String expected = "scm checkin --username myUserName --password myPassword " + getFiles();
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) JazzScmProviderRepository(org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)

Aggregations

JazzScmProviderRepository (org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)17 JazzScmCommand (org.apache.maven.scm.provider.jazz.command.JazzScmCommand)7 ErrorConsumer (org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer)6 DebugLoggerConsumer (org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)4 Commandline (org.codehaus.plexus.util.cli.Commandline)4 Matcher (java.util.regex.Matcher)3 StreamConsumer (org.codehaus.plexus.util.cli.StreamConsumer)3 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)2 File (java.io.File)1 URI (java.net.URI)1 ArrayList (java.util.ArrayList)1 ScmException (org.apache.maven.scm.ScmException)1 ScmFile (org.apache.maven.scm.ScmFile)1 ScmFileSet (org.apache.maven.scm.ScmFileSet)1 ScmResult (org.apache.maven.scm.ScmResult)1 AddScmResult (org.apache.maven.scm.command.add.AddScmResult)1 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)1 ListScmResult (org.apache.maven.scm.command.list.ListScmResult)1 TagScmResult (org.apache.maven.scm.command.tag.TagScmResult)1 JazzAddCommand (org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand)1