use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzEditCommand method createEditCommand.
protected JazzScmCommand createEditCommand(ScmProviderRepository repo, ScmFileSet fileSet) {
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_LOCK, JazzConstants.CMD_SUB_ACQUIRE, repo, fileSet, getLogger());
List<File> files = fileSet.getFileList();
if (files != null && !files.isEmpty()) {
for (File file : files) {
// Lock only the files specified
command.addArgument(file.getPath());
}
} else {
// Lock all files
command.addArgument(".");
}
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzListCommand method executeListCommand.
/**
* {@inheritDoc}
*/
protected ListScmResult executeListCommand(ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing list command...");
}
JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
JazzListConsumer listConsumer = new JazzListConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
JazzScmCommand listCmd = createListCommand(jazzRepo, fileSet, recursive, version);
int status = listCmd.execute(listConsumer, errConsumer);
if (status != 0) {
return new ListScmResult(listCmd.getCommandString(), "Error code for Jazz SCM list command - " + status, errConsumer.getOutput(), false);
}
return new ListScmResult(listCmd.getCommandString(), listConsumer.getFiles());
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzListCommand method createListCommand.
public JazzScmCommand createListCommand(JazzScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion version) {
// recursive is implicit in the command, so it is ignored. NOTE: V4 appears to have changed this.
// version is meaningless, so it is ignored.
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_LIST, JazzConstants.CMD_SUB_REMOTEFILES, repo, fileSet, getLogger());
if (recursive) {
command.addArgument(JazzConstants.ARG_DEPTH);
command.addArgument(JazzConstants.ARG_DEPTH_INFINTE);
}
command.addArgument(repo.getRepositoryWorkspace());
command.addArgument(repo.getComponent());
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzStatusCommand method createStatusCommand.
public JazzScmCommand createStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) {
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_STATUS, null, repo, false, fileSet, getLogger());
command.addArgument(JazzConstants.ARG_STATUS_WIDE_PRINT_OUT);
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzStatusCommand method executeStatusCommand.
/**
* {@inheritDoc}
*/
public StatusScmResult executeStatusCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing status command...");
}
JazzStatusConsumer statusConsumer = new JazzStatusConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
JazzScmCommand statusCmd = createStatusCommand(repo, fileSet);
int status = statusCmd.execute(statusConsumer, errConsumer);
if (status != 0) {
return new StatusScmResult(statusCmd.getCommandString(), "Error code for Jazz SCM status command - " + status, errConsumer.getOutput(), false);
}
if (getLogger().isDebugEnabled()) {
if (!statusConsumer.getChangedFiles().isEmpty()) {
getLogger().debug("Iterating over \"Status\" results");
for (ScmFile file : statusConsumer.getChangedFiles()) {
getLogger().debug(file.getPath() + " : " + file.getStatus());
}
} else {
getLogger().debug("There are no differences");
}
}
return new StatusScmResult(statusCmd.getCommandString(), statusConsumer.getChangedFiles());
}
Aggregations