use of org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository in project maven-scm by apache.
the class StarteamStatusCommand method executeStatusCommand.
// ----------------------------------------------------------------------
// AbstractStatusCommand Implementation
// ----------------------------------------------------------------------
/**
* {@inheritDoc}
*/
protected StatusScmResult executeStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
if (getLogger().isInfoEnabled()) {
getLogger().info("Working directory: " + fileSet.getBasedir().getAbsolutePath());
}
if (fileSet.getFileList().size() != 0) {
throw new ScmException("This provider doesn't support checking status of a subsets of a directory");
}
StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;
StarteamStatusConsumer consumer = new StarteamStatusConsumer(getLogger(), fileSet.getBasedir());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
Commandline cl = createCommandLine(repository, fileSet);
int exitCode = StarteamCommandLineUtils.executeCommandline(cl, consumer, stderr, getLogger());
if (exitCode != 0) {
return new StatusScmResult(cl.toString(), "The starteam command failed.", stderr.getOutput(), false);
}
return new StatusScmResult(cl.toString(), consumer.getChangedFiles());
}
use of org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository in project maven-scm by apache.
the class StarteamDiffCommandTest method testCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, ScmFileSet basedir, ScmVersion startLabel, ScmVersion endLabel, String commandLine) throws Exception {
ScmRepository repo = getScmManager().makeScmRepository(scmUrl);
StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
Commandline cl = StarteamDiffCommand.createCommandLine(repository, basedir, startLabel, endLabel);
assertCommandLine(commandLine, null, cl);
}
use of org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository in project maven-scm by apache.
the class StarteamStatusCommandTest method testCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, ScmFileSet workDir, String commandLine) throws Exception {
ScmRepository repo = getScmManager().makeScmRepository(scmUrl);
StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
Commandline cl = StarteamStatusCommand.createCommandLine(repository, workDir);
assertCommandLine(commandLine, null, cl);
}
use of org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository in project maven-scm by apache.
the class StarteamUpdateCommandTest method testCommandLine.
// ----------------------------------------------------------------------
//
// ----------------------------------------------------------------------
private void testCommandLine(String scmUrl, ScmFileSet fileSet, ScmVersion version, String commandLine) throws Exception {
ScmRepository repo = getScmManager().makeScmRepository(scmUrl);
StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo.getProviderRepository();
Commandline cl = StarteamUpdateCommand.createCommandLine(repository, fileSet, version);
System.out.println(commandLine);
System.out.println(cl);
assertCommandLine(commandLine, null, cl);
}
use of org.apache.maven.scm.provider.starteam.repository.StarteamScmProviderRepository in project maven-scm by apache.
the class StarteamTagCommand method executeTagCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeTagCommand(ScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters) throws ScmException {
if (fileSet.getFileList().isEmpty()) {
throw new ScmException("This provider doesn't support tagging subsets of a directory");
}
if (tag == null || tag.trim().length() == 0) {
throw new ScmException("tag must be specified");
}
if (getLogger().isInfoEnabled()) {
getLogger().info("Working directory: " + fileSet.getBasedir().getAbsolutePath());
}
StarteamScmProviderRepository repository = (StarteamScmProviderRepository) repo;
StarteamTagConsumer consumer = new StarteamTagConsumer(getLogger());
CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
Commandline cl = createCommandLine(repository, fileSet.getBasedir(), tag);
int exitCode = StarteamCommandLineUtils.executeCommandline(cl, consumer, stderr, getLogger());
if (exitCode != 0) {
return new TagScmResult(cl.toString(), "The starteam command failed.", stderr.getOutput(), false);
}
return new TagScmResult(cl.toString(), consumer.getTaggedFiles());
}
Aggregations