Search in sources :

Example 1 with ChangedFileConsumer

use of org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer in project maven-scm by apache.

the class TfsStatusCommandTest method setUp.

protected void setUp() throws Exception {
    super.setUp();
    consumer = new ChangedFileConsumer(new DefaultLog());
    defaultLocale = Locale.getDefault();
}
Also used : DefaultLog(org.apache.maven.scm.log.DefaultLog) ChangedFileConsumer(org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer)

Example 2 with ChangedFileConsumer

use of org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer in project maven-scm by apache.

the class TfsStatusCommand method executeStatusCommand.

protected StatusScmResult executeStatusCommand(ScmProviderRepository r, ScmFileSet f) throws ScmException {
    TfsScmProviderRepository tfsRepo = (TfsScmProviderRepository) r;
    TfsCommand command = createCommand(tfsRepo, f);
    ChangedFileConsumer out = new ChangedFileConsumer(getLogger());
    ErrorStreamConsumer err = new ErrorStreamConsumer();
    int status = command.execute(out, err);
    if (status != 0 || err.hasBeenFed()) {
        return new StatusScmResult(command.getCommandString(), "Error code for TFS status command - " + status, err.getOutput(), false);
    }
    Iterator<ScmFile> iter = out.getChangedFiles().iterator();
    getLogger().debug("Iterating");
    while (iter.hasNext()) {
        ScmFile file = (ScmFile) iter.next();
        getLogger().debug(file.getPath() + ":" + file.getStatus());
    }
    return new StatusScmResult(command.getCommandString(), out.getChangedFiles());
}
Also used : StatusScmResult(org.apache.maven.scm.command.status.StatusScmResult) TfsScmProviderRepository(org.apache.maven.scm.provider.tfs.TfsScmProviderRepository) ChangedFileConsumer(org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer) ErrorStreamConsumer(org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer) ScmFile(org.apache.maven.scm.ScmFile)

Aggregations

ChangedFileConsumer (org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer)2 ScmFile (org.apache.maven.scm.ScmFile)1 StatusScmResult (org.apache.maven.scm.command.status.StatusScmResult)1 DefaultLog (org.apache.maven.scm.log.DefaultLog)1 TfsScmProviderRepository (org.apache.maven.scm.provider.tfs.TfsScmProviderRepository)1 ErrorStreamConsumer (org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer)1