use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class TfsTagCommand method executeTagCommand.
protected ScmResult executeTagCommand(ScmProviderRepository r, ScmFileSet f, String tag, ScmTagParameters scmTagParameters) throws ScmException {
TfsCommand command = createCommand(r, f, tag, scmTagParameters);
StringStreamConsumer out = new StringStreamConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
int status = command.execute(out, err);
if (status != 0 || err.hasBeenFed()) {
return new TagScmResult(command.getCommandString(), "Error code for TFS label command - " + status, err.getOutput(), false);
}
List<ScmFile> files = new ArrayList<ScmFile>(f.getFileList().size());
for (File file : f.getFileList()) {
files.add(new ScmFile(file.getPath(), ScmFileStatus.TAGGED));
}
return new TagScmResult(command.getCommandString(), files);
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class VssTagConsumer method processGetFile.
/**
* Process the current input line in the Get File state.
*
* @param line a line of text from the VSS log output
*/
private void processGetFile(String line) {
String[] fileLine = line.split(" ");
updatedFiles.add(new ScmFile(currentPath + "/" + fileLine[1], ScmFileStatus.UPDATED));
if (getLogger().isInfoEnabled()) {
getLogger().info(fileLine[0] + ": " + currentPath + "/" + fileLine[1]);
}
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class TfsBranchCommand method executeBranchCommand.
protected ScmResult executeBranchCommand(ScmProviderRepository r, ScmFileSet f, String branch, String message) throws ScmException {
TfsCommand command = createCommand(r, f, branch);
StringStreamConsumer out = new StringStreamConsumer();
ErrorStreamConsumer err = new ErrorStreamConsumer();
int status = command.execute(out, err);
getLogger().info("status of branch command is= " + status + "; err= " + err.getOutput());
if (status != 0 || err.hasBeenFed()) {
return new BranchScmResult(command.getCommandString(), "Error code for TFS branch command - " + status, err.getOutput(), false);
}
return new BranchScmResult(command.getCommandString(), new ArrayList<ScmFile>(0));
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class TfsCommand method execute.
public int execute(StreamConsumer out, ErrorStreamConsumer err) throws ScmException {
info("Command line - " + getCommandString());
int status;
try {
status = CommandLineUtils.executeCommandLine(command, out, err);
} catch (CommandLineException e) {
throw new ScmException("Error while executing TFS command line - " + getCommandString(), e);
}
info("err - " + err.getOutput());
if (out instanceof StringStreamConsumer) {
StringStreamConsumer sc = (StringStreamConsumer) out;
debug(sc.getOutput());
}
if (out instanceof FileListConsumer) {
FileListConsumer f = (FileListConsumer) out;
for (Iterator<ScmFile> i = f.getFiles().iterator(); i.hasNext(); ) {
ScmFile file = i.next();
debug(file.getPath());
}
}
return status;
}
use of org.apache.maven.scm.ScmFile in project maven-scm by apache.
the class CvsTagConsumer method consumeLine.
/**
* {@inheritDoc}
*/
public void consumeLine(String line) {
if (logger.isDebugEnabled()) {
logger.debug(line);
}
if (line.length() < 3) {
if (StringUtils.isNotEmpty(line)) {
if (logger.isWarnEnabled()) {
logger.warn("Unable to parse output from command: line length must be bigger than 3. (" + line + ").");
}
}
return;
}
String status = line.substring(0, 2);
String file = line.substring(2);
if (status.equals("T ")) {
files.add(new ScmFile(file, ScmFileStatus.TAGGED));
} else {
if (logger.isWarnEnabled()) {
logger.warn("Unknown status: '" + status + "'.");
}
}
}
Aggregations