use of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer in project maven-scm by apache.
the class JazzListCommand method executeListCommand.
/**
* {@inheritDoc}
*/
protected ListScmResult executeListCommand(ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing list command...");
}
JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
JazzListConsumer listConsumer = new JazzListConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
JazzScmCommand listCmd = createListCommand(jazzRepo, fileSet, recursive, version);
int status = listCmd.execute(listConsumer, errConsumer);
if (status != 0) {
return new ListScmResult(listCmd.getCommandString(), "Error code for Jazz SCM list command - " + status, errConsumer.getOutput(), false);
}
return new ListScmResult(listCmd.getCommandString(), listConsumer.getFiles());
}
use of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer in project maven-scm by apache.
the class JazzStatusCommand method executeStatusCommand.
/**
* {@inheritDoc}
*/
public StatusScmResult executeStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing status command...");
}
JazzStatusConsumer statusConsumer = new JazzStatusConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
JazzScmCommand statusCmd = createStatusCommand(repo, fileSet);
int status = statusCmd.execute(statusConsumer, errConsumer);
if (status != 0) {
return new StatusScmResult(statusCmd.getCommandString(), "Error code for Jazz SCM status command - " + status, errConsumer.getOutput(), false);
}
if (getLogger().isDebugEnabled()) {
if (!statusConsumer.getChangedFiles().isEmpty()) {
getLogger().debug("Iterating over \"Status\" results");
for (ScmFile file : statusConsumer.getChangedFiles()) {
getLogger().debug(file.getPath() + " : " + file.getStatus());
}
} else {
getLogger().debug("There are no differences");
}
}
return new StatusScmResult(statusCmd.getCommandString(), statusConsumer.getChangedFiles());
}
use of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer 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);
}
use of org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer in project maven-scm by apache.
the class JazzBlameCommand method executeBlameCommand.
/**
* {@inheritDoc}
*/
public BlameScmResult executeBlameCommand(ScmProviderRepository repo, ScmFileSet fileSet, String filename) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing blame command...");
}
JazzScmCommand blameCmd = createBlameCommand(repo, fileSet, filename);
JazzBlameConsumer blameConsumer = new JazzBlameConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
int status = blameCmd.execute(blameConsumer, errConsumer);
if (status != 0) {
return new BlameScmResult(blameCmd.getCommandString(), "Error code for Jazz SCM blame command - " + status, errConsumer.getOutput(), false);
}
return new BlameScmResult(blameCmd.getCommandString(), blameConsumer.getLines());
}
Aggregations