use of org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository in project maven-scm by apache.
the class JazzStatusConsumer method consumeLine.
/**
* Process one line of output from the execution of the "scm status" command.
*
* @param line The line of output from the external command that has been pumped to us.
* @see org.codehaus.plexus.util.cli.StreamConsumer#consumeLine(java.lang.String)
*/
public void consumeLine(String line) {
super.consumeLine(line);
if (containsWorkspace(line)) {
extractWorkspace(line);
}
if (containsComponent(line)) {
extractComponent(line);
}
if (containsBaseline(line)) {
extractBaseline(line);
}
if (containsStatusFlag(line)) {
extractChangedFile(line);
}
if (containsOutgoing(line)) {
// Now looking for outgoing, not incoming
seenOutgoingChangeSets = true;
seenIncomingChangeSets = false;
}
if (containsIncoming(line)) {
// Now looking for incoming, not outgoing
seenOutgoingChangeSets = false;
seenIncomingChangeSets = true;
}
if (containsBaselines(line)) {
// Got to baselines, stop looking for all changesets
seenOutgoingChangeSets = false;
seenIncomingChangeSets = false;
}
if (seenOutgoingChangeSets) {
Integer changeSetAlias = extractChangeSetAlias(line);
if (changeSetAlias != null) {
// We are now supporting multiple change sets, as this allows
// us to cater for multiple changeset caused by previous failed
// release attempts.
// Our starting point should always be a clean slate of a workspace
// or sandbox, however, if something fails, then we will have some
// changesets already created, so we need to be able to deal with them effectively.
JazzScmProviderRepository jazzRepository = (JazzScmProviderRepository) getRepository();
jazzRepository.getOutgoingChangeSetAliases().add(new Integer(changeSetAlias));
}
}
if (seenIncomingChangeSets) {
Integer changeSetAlias = extractChangeSetAlias(line);
if (changeSetAlias != null) {
// We are now supporting multiple change sets, as this allows
// us to cater for multiple changeset caused by previous failed
// release attempts.
// Our starting point should always be a clean slate of a workspace
// or sandbox, however, if something fails, then we will have some
// changesets already created, so we need to be able to deal with them effectively.
JazzScmProviderRepository jazzRepository = (JazzScmProviderRepository) getRepository();
jazzRepository.getIncomingChangeSetAliases().add(new Integer(changeSetAlias));
}
}
}
use of org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository in project maven-scm by apache.
the class JazzCheckInCommandTest method testCreateCheckInCommandCheckingInSpecificFiles.
public void testCreateCheckInCommandCheckingInSpecificFiles() throws Exception {
JazzScmProviderRepository repo = getScmProviderRepository();
Commandline cmd = new JazzCheckInCommand().createCheckInCommand(repo, getScmFileSet()).getCommandline();
String expected = "scm checkin --username myUserName --password myPassword " + getFiles();
assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Aggregations