use of org.apache.maven.scm.command.unedit.UnEditScmResult in project maven-scm by apache.
the class PerforceUnEditCommand method executeUnEditCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeUnEditCommand(ScmProviderRepository repo, ScmFileSet files) throws ScmException {
Commandline cl = createCommandLine((PerforceScmProviderRepository) repo, files.getBasedir(), files);
PerforceUnEditConsumer consumer = new PerforceUnEditConsumer();
try {
CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
int exitCode = CommandLineUtils.executeCommandLine(cl, consumer, err);
if (exitCode != 0) {
String cmdLine = CommandLineUtils.toString(cl.getCommandline());
StringBuilder msg = new StringBuilder("Exit code: " + exitCode + " - " + err.getOutput());
msg.append('\n');
msg.append("Command line was:" + cmdLine);
throw new CommandLineException(msg.toString());
}
} catch (CommandLineException e) {
if (getLogger().isErrorEnabled()) {
getLogger().error("CommandLineException " + e.getMessage(), e);
}
}
if (consumer.isSuccess()) {
return new UnEditScmResult(cl.toString(), consumer.getEdits());
}
return new UnEditScmResult(cl.toString(), "Unable to revert", consumer.getOutput(), consumer.isSuccess());
}
use of org.apache.maven.scm.command.unedit.UnEditScmResult in project maven-scm by apache.
the class IntegrityScmProvider method unedit.
/**
* Maps to si revert
*/
@Override
protected UnEditScmResult unedit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params) throws ScmException {
IntegrityUnEditCommand command = new IntegrityUnEditCommand();
command.setLogger(getLogger());
return (UnEditScmResult) command.execute(repository, fileSet, params);
}
use of org.apache.maven.scm.command.unedit.UnEditScmResult in project maven-scm by apache.
the class TfsScmProvider method unedit.
protected UnEditScmResult unedit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
TfsUnEditCommand command = new TfsUnEditCommand();
command.setLogger(getLogger());
return (UnEditScmResult) command.execute(repository, fileSet, parameters);
}
use of org.apache.maven.scm.command.unedit.UnEditScmResult in project maven-scm by apache.
the class JazzScmProvider method unedit.
/**
* {@inheritDoc}
*/
protected UnEditScmResult unedit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
getLogger().debug("JazzScmProvider:unedit()");
JazzUnEditCommand command = new JazzUnEditCommand();
command.setLogger(getLogger());
return (UnEditScmResult) command.execute(repository, fileSet, parameters);
}
use of org.apache.maven.scm.command.unedit.UnEditScmResult in project maven-scm by apache.
the class StarteamScmProvider method unedit.
/**
* {@inheritDoc}
*/
protected UnEditScmResult unedit(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
fileSet = fixUpScmFileSetAbsoluteFilePath(fileSet);
StarteamUnEditCommand command = new StarteamUnEditCommand();
command.setLogger(getLogger());
return (UnEditScmResult) command.execute(repository, fileSet, parameters);
}
Aggregations