Search in sources :

Example 11 with TfsScmProviderRepository

use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository 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)

Example 12 with TfsScmProviderRepository

use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.

the class TfsAddCommandTest method testCommandline.

public void testCommandline() throws Exception {
    TfsScmProviderRepository repo = getScmProviderRepository();
    Commandline cmd = new TfsAddCommand().createCommand(repo, getScmFileSet()).getCommandline();
    String expected = "tf add -login:user,password " + getFileList();
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) TfsScmProviderRepository(org.apache.maven.scm.provider.tfs.TfsScmProviderRepository)

Example 13 with TfsScmProviderRepository

use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.

the class TfsChangeLogCommandTest method testCommandline.

public void testCommandline() throws Exception {
    TfsScmProviderRepository repo = getScmProviderRepository();
    File f = new File("file");
    Commandline cmd = new TfsChangeLogCommand().createCommand(repo, getScmFileSet(), f).getCommandline();
    String expected = "tf history -login:user,password -format:detailed " + f.getName();
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) TfsScmProviderRepository(org.apache.maven.scm.provider.tfs.TfsScmProviderRepository) ScmFile(org.apache.maven.scm.ScmFile) File(java.io.File)

Example 14 with TfsScmProviderRepository

use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.

the class TfsCheckOutCommandTest method testCommandline.

public void testCommandline() throws Exception {
    TfsScmProviderRepository repo = getScmProviderRepository();
    ScmRevision rev = new ScmRevision("revision");
    String path = getScmFileSet().getBasedir().getAbsolutePath();
    Commandline cmd = new TfsCheckOutCommand().createGetCommand(repo, getScmFileSet(), rev, true).getCommandline();
    String expected = "tf get -login:user,password -recursive -force -version:Crevision " + path;
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) ScmRevision(org.apache.maven.scm.ScmRevision) TfsScmProviderRepository(org.apache.maven.scm.provider.tfs.TfsScmProviderRepository)

Example 15 with TfsScmProviderRepository

use of org.apache.maven.scm.provider.tfs.TfsScmProviderRepository in project maven-scm by apache.

the class TfsCheckInCommandTest method testCommandline.

public void testCommandline() throws Exception {
    TfsScmProviderRepository repo = getScmProviderRepository();
    Commandline cmd = new TfsCheckInCommand().createCommand(repo, getScmFileSet(), "A comment of many words").getCommandline();
    String expected = "tf checkin -login:user,password -noprompt -comment:\"A comment of many words\" " + getFileList();
    assertCommandLine(expected, getWorkingDirectory(), cmd);
}
Also used : Commandline(org.codehaus.plexus.util.cli.Commandline) TfsScmProviderRepository(org.apache.maven.scm.provider.tfs.TfsScmProviderRepository)

Aggregations

TfsScmProviderRepository (org.apache.maven.scm.provider.tfs.TfsScmProviderRepository)16 Commandline (org.codehaus.plexus.util.cli.Commandline)11 ErrorStreamConsumer (org.apache.maven.scm.provider.tfs.command.consumer.ErrorStreamConsumer)3 ScmFile (org.apache.maven.scm.ScmFile)2 ScmRevision (org.apache.maven.scm.ScmRevision)2 File (java.io.File)1 ScmTagParameters (org.apache.maven.scm.ScmTagParameters)1 CheckOutScmResult (org.apache.maven.scm.command.checkout.CheckOutScmResult)1 StatusScmResult (org.apache.maven.scm.command.status.StatusScmResult)1 ChangedFileConsumer (org.apache.maven.scm.provider.tfs.command.consumer.ChangedFileConsumer)1 FileListConsumer (org.apache.maven.scm.provider.tfs.command.consumer.FileListConsumer)1