Package org.apache.maven.scm.command.remoteinfo

Examples of org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult


    public RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet,
                                           CommandParameters parameters )
        throws ScmException
    {
        return new RemoteInfoScmResult( "", null, null );
    }
View Full Code Here


            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet == null ? null : fileSet.getBasedir(),
                                                        (SvnScmProviderRepository) repository );

        cl.createArg().setValue( "ls" );

        cl.createArg().setValue( baseUrl + "/tags" );

        stderr = new CommandLineUtils.StringStreamConsumer();

        consumer = new LsConsumer( getLogger(), baseUrl );

        Map<String, String> branchesInfos = null;

        try
        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
            branchesInfos = consumer.infos;

        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        return new RemoteInfoScmResult( cl.toString(), branchesInfos, tagsInfos );
    }
View Full Code Here

    public RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet,
                                           CommandParameters parameters )
        throws ScmException
    {
        return new RemoteInfoScmResult( "", null, null );
    }
View Full Code Here

            lastCommandLine = clClone.toString();
        }

        GitRemoteInfoCommand gitRemoteInfoCommand = new GitRemoteInfoCommand();
        gitRemoteInfoCommand.setLogger( getLogger() );
        RemoteInfoScmResult result = gitRemoteInfoCommand.executeRemoteInfoCommand( repository, null, null );

        if ( fileSet.getBasedir().exists() && new File( fileSet.getBasedir(), ".git" ).exists()
            && result.getBranches().size() > 0 )
        {
            // git repo exists, so we must git-pull the changes
            Commandline clPull = createPullCommand( repository, fileSet.getBasedir(), version );

            exitCode = GitCommandLineUtils.execute( clPull, stdout, stderr, getLogger() );
View Full Code Here

    public GitRemoteInfoConsumer( ScmLogger logger, String commandLine )
    {
        this.logger = logger;
        this.remoteInfoScmResult =
            new RemoteInfoScmResult( commandLine, new HashMap<String, String>(), new HashMap<String, String>() );

        try
        {
            this.branchRegexp = new RE( BRANCH_PATTERN );
            this.tagRegexp = new RE( TAGS_PATTERN );
View Full Code Here

            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        cl = SvnCommandLineUtils.getBaseSvnCommandLine( fileSet == null ? null : fileSet.getBasedir(),
                                                        (SvnScmProviderRepository) repository );

        cl.createArg().setValue( "ls" );

        cl.createArg().setValue( baseUrl + "/tags" );

        stderr = new CommandLineUtils.StringStreamConsumer();

        consumer = new LsConsumer( getLogger(), baseUrl );

        Map<String, String> branchesInfos = null;

        try
        {
            exitCode = SvnCommandLineUtils.execute( cl, consumer, stderr, getLogger() );
            branchesInfos = consumer.infos;

        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing svn command.", ex );
        }

        if ( exitCode != 0 )
        {
            return new RemoteInfoScmResult( cl.toString(), "The svn command failed.", stderr.getOutput(), false );
        }

        return new RemoteInfoScmResult( cl.toString(), branchesInfos, tagsInfos );
    }
View Full Code Here

        consumer.consumeLine( "344581899752998038a74989142221ae08c381bc  HEAD" );
        consumer.consumeLine( "344581899752998038a74989142221ae08c381bc  refs/heads/master" );
        consumer.consumeLine( "9006c3dbaa9749aa435694f261638583c9088419  refs/tags/staging" );

        RemoteInfoScmResult remoteInfoScmResult = consumer.getRemoteInfoScmResult();

        assertEquals( 1, remoteInfoScmResult.getBranches().size() );
        assertEquals( "344581899752998038a74989142221ae08c381bc", remoteInfoScmResult.getBranches().get( "master" ) );

        assertEquals( 1, remoteInfoScmResult.getTags().size() );
        assertEquals( "9006c3dbaa9749aa435694f261638583c9088419", remoteInfoScmResult.getTags().get( "staging" ) );
    }
View Full Code Here

    public void testRemoteInfoCommand()
        throws Exception
    {
        ScmProvider provider = getScmManager().getProviderByRepository( getScmRepository() );
        RemoteInfoScmResult result =
            provider.remoteInfo( getScmProviderRepository(), new ScmFileSet( getWorkingCopy() ), null );

        checkResult( result );
    }
View Full Code Here

    public RemoteInfoScmResult remoteInfo( ScmProviderRepository repository, ScmFileSet fileSet,
                                           CommandParameters parameters )
        throws ScmException
    {
        return new RemoteInfoScmResult( "", null, null );
    }
View Full Code Here

            lastCommandLine = clClone.toString();
        }

        GitRemoteInfoCommand gitRemoteInfoCommand = new GitRemoteInfoCommand();
        gitRemoteInfoCommand.setLogger( getLogger() );
        RemoteInfoScmResult result = gitRemoteInfoCommand.executeRemoteInfoCommand( repository, null, null );

        if ( fileSet.getBasedir().exists() && new File( fileSet.getBasedir(), ".git" ).exists()
            && result.getBranches().size() > 0 )
        {
            // git repo exists, so we must git-pull the changes
            Commandline clPull = createPullCommand( repository, fileSet.getBasedir(), version );

            exitCode = GitCommandLineUtils.execute( clPull, stdout, stderr, getLogger() );
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.remoteinfo.RemoteInfoScmResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.