use of org.codehaus.plexus.util.cli.CommandLineException in project maven-scm by apache.
the class CvsExeStatusCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected StatusScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsStatusConsumer consumer = new CvsStatusConsumer(getLogger(), cl.getWorkingDirectory());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
try {
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
if (exitCode != 0) {
return new StatusScmResult(cl.toString(), "The cvs command failed.", stderr.getOutput(), false);
}
return new StatusScmResult(cl.toString(), consumer.getChangedFiles());
}
use of org.codehaus.plexus.util.cli.CommandLineException in project maven-scm by apache.
the class CvsExeUpdateCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected UpdateScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsUpdateConsumer consumer = new CvsUpdateConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
try {
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
if (exitCode != 0) {
return new UpdateScmResult(cl.toString(), "The cvs command failed.", stderr.getOutput(), false);
}
return new UpdateScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.codehaus.plexus.util.cli.CommandLineException in project maven-scm by apache.
the class CvsExeBranchCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected BranchScmResult executeCvsCommand(Commandline cl) throws ScmException {
int exitCode;
CvsBranchConsumer consumer = new CvsBranchConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
try {
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
if (exitCode != 0) {
return new BranchScmResult(cl.toString(), "The cvs branch command failed.", stderr.getOutput(), false);
}
return new BranchScmResult(cl.toString(), consumer.getTaggedFiles());
}
use of org.codehaus.plexus.util.cli.CommandLineException in project maven-scm by apache.
the class CvsExeCheckInCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected CheckInScmResult executeCvsCommand(Commandline cl, CvsScmProviderRepository repository, File messageFile) throws ScmException {
CvsCheckInConsumer consumer = new CvsCheckInConsumer(repository.getPath(), getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
try {
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
try {
FileUtils.forceDelete(messageFile);
} catch (IOException ex) {
// ignore
}
if (exitCode != 0) {
return new CheckInScmResult(cl.toString(), "The cvs command failed.", stderr.getOutput(), false);
}
return new CheckInScmResult(cl.toString(), consumer.getCheckedInFiles());
}
use of org.codehaus.plexus.util.cli.CommandLineException in project maven-scm by apache.
the class CvsExeDiffCommand method executeCvsCommand.
/**
* {@inheritDoc}
*/
protected DiffScmResult executeCvsCommand(Commandline cl) throws ScmException {
CvsDiffConsumer consumer = new CvsDiffConsumer(getLogger(), cl.getWorkingDirectory());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
try {
CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing command.", ex);
}
return new DiffScmResult(cl.toString(), consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch());
}
Aggregations