use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzTagCommand method createTagCreateSnapshotCommand.
// Create the JazzScmCommand to execute the "scm create snapshot ..." command
// This will create a snapshot of the remote repository
public JazzScmCommand createTagCreateSnapshotCommand(JazzScmProviderRepository repo, ScmFileSet fileSet, String tag, ScmTagParameters scmTagParameters) {
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_CREATE, JazzConstants.CMD_SUB_SNAPSHOT, repo, fileSet, getLogger());
if (tag != null && !tag.trim().equals("")) {
command.addArgument(JazzConstants.ARG_SNAPSHOT_NAME);
command.addArgument(tag);
}
String message = scmTagParameters.getMessage();
if (message != null && !message.trim().equals("")) {
command.addArgument(JazzConstants.ARG_SNAPSHOT_DESCRIPTION);
command.addArgument(message);
}
command.addArgument(repo.getRepositoryWorkspace());
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzTagCommand method createTagCreateWorkspaceCommand.
// Create the JazzScmCommand to execute the "scm create workspace ..." command
// This will create a workspace of the same name as the tag.
public JazzScmCommand createTagCreateWorkspaceCommand(JazzScmProviderRepository repo, ScmFileSet fileSet, String tag) {
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_CREATE, JazzConstants.CMD_SUB_WORKSPACE, repo, fileSet, getLogger());
if (tag != null && !tag.trim().equals("")) {
command.addArgument(tag);
command.addArgument(JazzConstants.ARG_WORKSPACE_SNAPSHOT);
command.addArgument(tag);
}
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzUnEditCommand method executeUnEditCommand.
/**
* {@inheritDoc}
*/
protected ScmResult executeUnEditCommand(ScmProviderRepository repo, ScmFileSet fileSet) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing unedit command...");
}
DebugLoggerConsumer uneditConsumer = new DebugLoggerConsumer(getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
JazzScmCommand uneditCmd = createUneditCommand(repo, fileSet);
int status = uneditCmd.execute(uneditConsumer, errConsumer);
if (status != 0) {
return new UnEditScmResult(uneditCmd.getCommandString(), "Error code for Jazz SCM unedit command - " + status, errConsumer.getOutput(), false);
}
return new UnEditScmResult(uneditCmd.getCommandString(), "Successfully Completed.", uneditConsumer.getOutput(), true);
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzAddCommand method createAddCommand.
public JazzScmCommand createAddCommand(ScmProviderRepository repo, ScmFileSet fileSet) {
JazzScmCommand command = new JazzScmCommand(JazzConstants.CMD_CHECKIN, null, repo, false, fileSet, getLogger());
List<File> files = fileSet.getFileList();
if (files != null && !files.isEmpty()) {
for (File file : files) {
// Check in only the files specified
command.addArgument(file.getPath());
}
} else {
// This will check in all local changes
command.addArgument(".");
}
return command;
}
use of org.apache.maven.scm.provider.jazz.command.JazzScmCommand in project maven-scm by apache.
the class JazzBlameCommand method executeBlameCommand.
/**
* {@inheritDoc}
*/
public BlameScmResult executeBlameCommand(ScmProviderRepository repo, ScmFileSet fileSet, String filename) throws ScmException {
if (getLogger().isDebugEnabled()) {
getLogger().debug("Executing blame command...");
}
JazzScmCommand blameCmd = createBlameCommand(repo, fileSet, filename);
JazzBlameConsumer blameConsumer = new JazzBlameConsumer(repo, getLogger());
ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
int status = blameCmd.execute(blameConsumer, errConsumer);
if (status != 0) {
return new BlameScmResult(blameCmd.getCommandString(), "Error code for Jazz SCM blame command - " + status, errConsumer.getOutput(), false);
}
return new BlameScmResult(blameCmd.getCommandString(), blameConsumer.getLines());
}
Aggregations