Search in sources :

Example 16 with ListScmResult

use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.

the class SvnMkdirCommandTckTest method testMkdirCommandMkdirUrl.

public void testMkdirCommandMkdirUrl() throws Exception {
    ScmFileSet fileSet = new ScmFileSet(getWorkingCopy(), new File(getMissingDirectory()));
    MkdirScmResult result = getScmManager().mkdir(getScmRepository(), fileSet, "Mkdir message", false);
    assertResultIsSuccess(result);
    assertNotNull(result.getRevision());
    ListScmResult listResult = getScmManager().list(getScmRepository(), fileSet, true, null);
    assertTrue("Directory should have been found.", listResult.isSuccess());
}
Also used : ScmFileSet(org.apache.maven.scm.ScmFileSet) MkdirScmResult(org.apache.maven.scm.command.mkdir.MkdirScmResult) ListScmResult(org.apache.maven.scm.command.list.ListScmResult) File(java.io.File)

Example 17 with ListScmResult

use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.

the class HgScmProvider method list.

/**
 * @since 1.5
 * {@inheritDoc}
 */
@Override
protected ListScmResult list(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    HgListCommand hgListCommand = new HgListCommand();
    hgListCommand.setLogger(getLogger());
    return (ListScmResult) hgListCommand.executeCommand(repository, fileSet, parameters);
}
Also used : HgListCommand(org.apache.maven.scm.provider.hg.command.inventory.HgListCommand) ListScmResult(org.apache.maven.scm.command.list.ListScmResult)

Example 18 with ListScmResult

use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.

the class IntegrityScmProvider method list.

/**
 * Maps to si viewproject
 */
@Override
protected ListScmResult list(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters params) throws ScmException {
    IntegrityListCommand command = new IntegrityListCommand();
    command.setLogger(getLogger());
    return (ListScmResult) command.execute(repository, fileSet, params);
}
Also used : IntegrityListCommand(org.apache.maven.scm.provider.integrity.command.list.IntegrityListCommand) ListScmResult(org.apache.maven.scm.command.list.ListScmResult)

Example 19 with ListScmResult

use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.

the class JazzListCommand method executeListCommand.

/**
 * {@inheritDoc}
 */
protected ListScmResult executeListCommand(ScmProviderRepository repo, ScmFileSet fileSet, boolean recursive, ScmVersion version) throws ScmException {
    if (getLogger().isDebugEnabled()) {
        getLogger().debug("Executing list command...");
    }
    JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
    JazzListConsumer listConsumer = new JazzListConsumer(repo, getLogger());
    ErrorConsumer errConsumer = new ErrorConsumer(getLogger());
    JazzScmCommand listCmd = createListCommand(jazzRepo, fileSet, recursive, version);
    int status = listCmd.execute(listConsumer, errConsumer);
    if (status != 0) {
        return new ListScmResult(listCmd.getCommandString(), "Error code for Jazz SCM list command - " + status, errConsumer.getOutput(), false);
    }
    return new ListScmResult(listCmd.getCommandString(), listConsumer.getFiles());
}
Also used : ErrorConsumer(org.apache.maven.scm.provider.jazz.command.consumer.ErrorConsumer) ListScmResult(org.apache.maven.scm.command.list.ListScmResult) JazzScmCommand(org.apache.maven.scm.provider.jazz.command.JazzScmCommand) JazzScmProviderRepository(org.apache.maven.scm.provider.jazz.repository.JazzScmProviderRepository)

Example 20 with ListScmResult

use of org.apache.maven.scm.command.list.ListScmResult in project maven-scm by apache.

the class JazzScmProvider method list.

/**
 * {@inheritDoc}
 */
protected ListScmResult list(ScmProviderRepository repository, ScmFileSet fileSet, CommandParameters parameters) throws ScmException {
    getLogger().debug("JazzScmProvider:list()");
    // We need to call the status command first, so that we can get the details of the stream etc.
    // This is needed for workspace and component names.
    JazzStatusCommand statusCommand = new JazzStatusCommand();
    statusCommand.setLogger(getLogger());
    statusCommand.execute(repository, fileSet, parameters);
    JazzListCommand command = new JazzListCommand();
    command.setLogger(getLogger());
    return (ListScmResult) command.execute(repository, fileSet, parameters);
}
Also used : JazzStatusCommand(org.apache.maven.scm.provider.jazz.command.status.JazzStatusCommand) ListScmResult(org.apache.maven.scm.command.list.ListScmResult) JazzListCommand(org.apache.maven.scm.provider.jazz.command.list.JazzListCommand)

Aggregations

ListScmResult (org.apache.maven.scm.command.list.ListScmResult)22 ScmException (org.apache.maven.scm.ScmException)8 File (java.io.File)7 ScmFile (org.apache.maven.scm.ScmFile)5 ScmFileSet (org.apache.maven.scm.ScmFileSet)5 MkdirScmResult (org.apache.maven.scm.command.mkdir.MkdirScmResult)4 ArrayList (java.util.ArrayList)3 CommandLineUtils (org.codehaus.plexus.util.cli.CommandLineUtils)3 ScmResult (org.apache.maven.scm.ScmResult)2 ScmProvider (org.apache.maven.scm.provider.ScmProvider)2 CvsListConsumer (org.apache.maven.scm.provider.cvslib.command.list.CvsListConsumer)2 CommandLineException (org.codehaus.plexus.util.cli.CommandLineException)2 Commandline (org.codehaus.plexus.util.cli.Commandline)2 APIException (com.mks.api.response.APIException)1 BufferedReader (java.io.BufferedReader)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 MojoExecutionException (org.apache.maven.plugin.MojoExecutionException)1 CvsLogListener (org.apache.maven.scm.provider.cvslib.cvsjava.util.CvsLogListener)1