Search in sources :

Example 6 with DebugLoggerConsumer

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

the class JazzEditCommand method executeEditCommand.

/**
 * {@inheritDoc}
 */
protected ScmResult executeEditCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("Executing edit command...");
    }
    DebugLoggerConsumer editConsumer = new DebugLoggerConsumer(getLogger());
    ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
    JazzScmCommand editCmd = createEditCommand(repo, fileSet);
    int status = editCmd.execute(editConsumer, errConsumer);
    if (status != 0) {
        return new EditScmResult(editCmd.getCommandString(), "Error code for Jazz SCM edit command - " + status, errConsumer.getOutput(), false);
    }
    return new EditScmResult(editCmd.getCommandString(), "Successfully Completed.", editConsumer.getOutput(), true);
}
Also used : ErrorConsumer(org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer) EditScmResult(org.apache.maven.scm.command.edit.EditScmResult) JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) DebugLoggerConsumer(org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)

Example 7 with DebugLoggerConsumer

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

the class JazzUnEditCommand method executeUnEditCommand.

/**
 * {@inheritDoc}
 */
protected ScmResult executeUnEditCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("Executing unedit command...");
    }
    DebugLoggerConsumer uneditConsumer = new DebugLoggerConsumer(getLogger());
    ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
    JazzScmCommand uneditCmd = createUneditCommand(repo, fileSet);
    int status = uneditCmd.execute(uneditConsumer, errConsumer);
    if (status != 0) {
        return new UnEditScmResult(uneditCmd.getCommandString(), "Error code for Jazz SCM unedit command - " + status, errConsumer.getOutput(), false);
    }
    return new UnEditScmResult(uneditCmd.getCommandString(), "Successfully Completed.", uneditConsumer.getOutput(), true);
}
Also used : ErrorConsumer(org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer) UnEditScmResult(org.apache.maven.scm.command.unedit.UnEditScmResult) JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) DebugLoggerConsumer(org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)

Aggregations

DebugLoggerConsumer (org.apache.maven.scm.provider.jazz.command.consumer.DebugLoggerConsumer)7 ErrorConsumer (org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer)7 JazzScmCommand (org.apache.maven.scm.provider.jazz.command.JazzScmCommand)6 JazzScmProviderRepository (org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)4 StreamConsumer (org.codehaus.plexus.util.cli.StreamConsumer)3 File (java.io.File)2 ScmFile (org.apache.maven.scm.ScmFile)2 CheckInScmResult (org.apache.maven.scm.command.checkin.CheckInScmResult)2 JazzStatusCommand (org.apache.maven.scm.provider.jazz.command.status.JazzStatusCommand)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 ScmException (org.apache.maven.scm.ScmException)1 ScmResult (org.apache.maven.scm.ScmResult)1 AddScmResult (org.apache.maven.scm.command.add.AddScmResult)1 DiffScmResult (org.apache.maven.scm.command.diff.DiffScmResult)1 EditScmResult (org.apache.maven.scm.command.edit.EditScmResult)1 StatusScmResult (org.apache.maven.scm.command.status.StatusScmResult)1 TagScmResult (org.apache.maven.scm.command.tag.TagScmResult)1 UnEditScmResult (org.apache.maven.scm.command.unedit.UnEditScmResult)1 JazzAddCommand (org.apache.maven.scm.provider.jazz.command.add.JazzAddCommand)1