use of org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository in project maven-scm by apache.
the class VssHistoryCommand method executeChangeLogCommand.
/**
* {@inheritDoc}
*/
protected ChangeLogScmResult executeChangeLogCommand(ScmProviderRepository repository, ScmFileSet fileSet, Date startDate, Date endDate, ScmBranch branch, String datePattern) throws ScmException {
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
Commandline cl = buildCmdLine(repo, fileSet, startDate, endDate);
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
VssChangeLogConsumer consumer = new VssChangeLogConsumer(repo, datePattern, getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
int exitCode = VssCommandLineUtils.executeCommandline(cl, consumer, stderr, getLogger());
if (exitCode != 0) {
return new ChangeLogScmResult(cl.toString(), "The vss command failed.", stderr.getOutput(), false);
}
return new ChangeLogScmResult(cl.toString(), new ChangeLogSet(consumer.getModifications(), startDate, endDate));
}
use of org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository in project maven-scm by apache.
the class VssCheckOutCommand method executeCheckOutCommand.
/**
* {@inheritDoc}
*/
protected CheckOutScmResult executeCheckOutCommand(ScmProviderRepository repository, ScmFileSet fileSet, ScmVersion version, boolean recursive, boolean shallow) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("executing checkout command...");
}
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
Commandline cl = buildCmdLine(repo, fileSet, version);
VssCheckOutConsumer consumer = new VssCheckOutConsumer(repo, getLogger());
// TODO handle deleted files from VSS
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 CheckOutScmResult(cl.toString(), "The vss command failed.", error, false);
}
// print out the writable copy for manual handling
if (getLogger().isWarnEnabled()) {
getLogger().warn(error);
}
}
return new CheckOutScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository in project maven-scm by apache.
the class VssStatusCommand method executeStatusCommand.
/**
* {@inheritDoc}
*/
protected StatusScmResult executeStatusCommand(ScmProviderRepository repository, ScmFileSet fileSet) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("executing status command...");
}
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
Commandline cl = buildCmdLine(repo, fileSet);
VssStatusConsumer consumer = new VssStatusConsumer(repo, getLogger(), fileSet);
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 + "]");
}
return new StatusScmResult(cl.toString(), "The vss command failed.", error, false);
}
return new StatusScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository in project maven-scm by apache.
the class VssTagCommand method executeTagCommand.
/**
* @see org.apache.maven.scm.command.tag.AbstractTagCommand#executeTagCommand(org.apache.maven.scm.provider.ScmProviderRepository, org.apache.maven.scm.ScmFileSet, java.lang.String, java.lang.String)
*/
protected ScmResult executeTagCommand(ScmProviderRepository repository, ScmFileSet fileSet, String tagName, String message) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("executing tag command...");
}
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
Commandline cl = buildCmdLine(repo, fileSet, tagName, message);
VssTagConsumer consumer = new VssTagConsumer(repo, getLogger());
// TODO handle deleted files from VSS
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 TagScmResult(cl.toString(), "The vss command failed.", error, false);
}
// print out the writable copy for manual handling
if (getLogger().isWarnEnabled()) {
getLogger().warn(error);
}
}
return new TagScmResult(cl.toString(), consumer.getUpdatedFiles());
}
use of org.apache.maven.scm.provider.vss.repository.VssScmProviderRepository in project maven-scm by apache.
the class VssAddCommand method executeAddCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeAddCommand(ScmProviderRepository repository, ScmFileSet fileSet, String message, boolean binary) throws ScmException {
VssScmProviderRepository repo = (VssScmProviderRepository) repository;
if (fileSet.getFileList().isEmpty()) {
throw new ScmException("You must provide at least one file/directory to add");
}
Commandline cl = buildCmdLine(repo, fileSet);
VssAddConsumer consumer = new VssAddConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
if (getLogger().isInfoEnabled()) {
getLogger().info("Executing: " + cl);
getLogger().info("Working directory: " + cl.getWorkingDirectory().getAbsolutePath());
}
int exitCode = VssCommandLineUtils.executeCommandline(cl, consumer, stderr, getLogger());
if (exitCode != 0) {
return new ChangeLogScmResult(cl.toString(), "The vss command failed.", stderr.getOutput(), false);
}
return new AddScmResult(cl.toString(), consumer.getAddedFiles());
}
Aggregations