use of org.apache.maven.scm.command.update.UpdateScmResult in project maven-scm by apache.
the class BazaarScmProvider method update.
/**
* {@inheritDoc}
*/
public UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
BazaarUpdateCommand command = new BazaarUpdateCommand();
command.setLogger(getLogger());
return (UpdateScmResult) command.execute(repository, fileSet, parameters);
}
use of org.apache.maven.scm.command.update.UpdateScmResult in project maven-scm by apache.
the class TfsUpdateCommand method executeUpdateCommand.
protected UpdateScmResult executeUpdateCommand(ScmProviderRepository r, ScmFileSet f, ScmVersion v) throws ScmException {
FileListConsumer fileConsumer = new FileListConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
TfsCommand command = createCommand(r, f, v);
int status = command.execute(fileConsumer, err);
if (status != 0 || err.hasBeenFed()) {
return new UpdateScmResult(command.getCommandString(), "Error code for TFS update command - " + status, err.getOutput(), false);
}
return new UpdateScmResult(command.getCommandString(), fileConsumer.getFiles());
}
use of org.apache.maven.scm.command.update.UpdateScmResult in project maven-scm by apache.
the class VssUpdateCommand method executeUpdateCommand.
// TODO handle deleted files from VSS
/**
* {@inheritDoc}
*/
protected UpdateScmResult executeUpdateCommand(ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("executing update command...");
}
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
Commandline cl = buildCmdLine(repo, fileSet, version);
VssUpdateConsumer consumer = new VssUpdateConsumer(repo, getLogger());
// TODO handle deleted files from VSS
// TODO identify local files
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString());
}
exitCode = VssCommandLineUtils.executeCommandline(cl, consumer, stderr, getLogger());
if (exitCode != 0) {
String error = stderr.getOutput();
if (getLogger().isDebugEnabled()) {
getLogger().debug("VSS returns error: [" + error + "] return code: [" + exitCode + "]");
}
if (error.indexOf("A writable copy of") < 0) {
return new UpdateScmResult(cl.toString(), "The vss command failed.", error, false);
}
// print out the writable copy for manual handling
if (getLogger().isWarnEnabled()) {
getLogger().warn(error);
}
}
return new UpdateScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.apache.maven.scm.command.update.UpdateScmResult in project maven-scm by apache.
the class HgScmProvider method update.
/**
* {@inheritDoc}
*/
public UpdateScmResult update(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
HgUpdateCommand command = new HgUpdateCommand();
command.setLogger(getLogger());
return (UpdateScmResult) command.execute(repository, fileSet, parameters);
}
use of org.apache.maven.scm.command.update.UpdateScmResult in project maven-scm by apache.
the class ClearCaseUpdateCommand method executeUpdateCommand.
/**
* {@inheritDoc}
*/
protected UpdateScmResult executeUpdateCommand(ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("executing update command...");
}
Commandline cl = createCommandLine(fileSet);
ClearCaseUpdateConsumer consumer = new ClearCaseUpdateConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode;
try {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing: " + cl.getWorkingDirectory().getAbsolutePath() + ">>" + cl.toString());
}
exitCode = CommandLineUtils.executeCommandLine(cl, consumer, stderr);
} catch (CommandLineException ex) {
throw new ScmException("Error while executing clearcase command.", ex);
}
if (exitCode != 0) {
return new UpdateScmResult(cl.toString(), "The cleartool command failed.", stderr.getOutput(), false);
}
return new UpdateScmResult(cl.toString(), consumer.getUpdatedFiles());
}
Aggregations