Package org.apache.maven.scm.provider.accurev

Examples of org.apache.maven.scm.provider.accurev.AccuRevInfo


    @Override
    protected List<File> extractSource( AccuRevScmProviderRepository repository, File basedir, AccuRevVersion version )
        throws AccuRevException
    {
        AccuRev accuRev = repository.getAccuRev();
        AccuRevInfo info = accuRev.info( basedir );
        String basisStream = version.getBasisStream();
        String transactionId = version.getTimeSpec();

        if ( !AccuRevVersion.isNow( transactionId )
            && !AccuRevCapability.POPULATE_TO_TRANSACTION.isSupported( accuRev.getClientVersion() ) )
        {
            getLogger().warn(
                              String.format( "Ignoring transaction id %s, Export can only extract current sources",
                                             transactionId ) );
            transactionId = "now";
        } else {
            //We might be heading to a transaction id that is not yet available on a replica
            accuRev.syncReplica();           
        }

        boolean removedWorkspace = false;

        // We'll do a pop -V.

        if ( info.isWorkSpace() )
        {

            String stat = accuRev.stat( basedir );

            if ( stat != null )
            {
                throw new AccuRevException(
                                            String.format(
                                                           "Cannot populate %s, as it is a non-ignored subdirectory of workspace %s rooted at %s.",
                                                           basedir.getAbsolutePath(), info.getWorkSpace(),
                                                           info.getTop() ) );
            }

            // ok, the subdirectory must be ignored. temporarily remove the workspace.
            removedWorkspace = accuRev.rmws( info.getWorkSpace() );

        }

        try
        {
            return accuRev.popExternal(
                                        basedir,
                                        basisStream,
                                        transactionId,
                                        Collections.singletonList( new File( repository.getDepotRelativeProjectPath() ) ) );

        }
        finally
        {
            if ( removedWorkspace )
            {
                accuRev.reactivate( info.getWorkSpace() );
            }
        }
    }
View Full Code Here


        throws AccuRevException
    {

        setWorkingDirectory( basedir );
        String[] info = { "info" };
        AccuRevInfo result = new AccuRevInfo( basedir );

        executeCommandLine( info, null, new InfoConsumer( result ) );
        return result;
    }
View Full Code Here

        super.setUp();
        logger = AccuRevJUnitUtil.getLogger( getContainer() );
        basedir = getWorkingCopy();
        sequence = inOrder( accurev );

        info = new AccuRevInfo( basedir );
        info.setUser( "me" );

        when( accurev.getCommandLines() ).thenReturn( "accurev mock" );
        when( accurev.getErrorOutput() ).thenReturn( "accurev mock error output" );
        when( accurev.getClientVersion() ).thenReturn( "4.9.0" );
View Full Code Here

    @Test
    public void testConsumeOutsideWorkspace()
        throws Exception
    {

        AccuRevInfo info = consume( "/info.outsideworkspace.txt" );

        assertNull( info.getBasis() );
        assertNull( info.getTop() );
        assertNull( info.getWorkSpace() );
        assertThat( info.getUser(), is( "ggardner" ) );
        assertThat( info.isLoggedIn(), is( true ) );

    }
View Full Code Here

    @Test
    public void testConsumeInsideWorkspace()
        throws Exception
    {
        AccuRevInfo info = consume( "/info.inworkspace.txt" );

        assertThat( info.getBasis(), is( "maventst" ) );
        assertThat( info.getTop(), is( "/home/ggardner/accurev/ws/maventst" ) );
        assertThat( info.getWorkSpace(), is( "maventst_ggardner" ) );
        assertThat( info.getUser(), is( "ggardner" ) );

    }
View Full Code Here

    @Test
    public void testNotLoggedIn()
        throws Exception
    {
        AccuRevInfo info = consume( "/info.notloggedin.txt" );
        assertThat( info.isLoggedIn(), is( false ) );
    }
View Full Code Here

    }

    private AccuRevInfo consume( String resource )
        throws IOException
    {
        AccuRevInfo info = new AccuRevInfo( new File( "/my/project/dir" ) );
        StreamConsumer consumer = new InfoConsumer( info );

        BufferedReader reader =
            new BufferedReader( new InputStreamReader( this.getClass().getResourceAsStream( resource ) ) );
View Full Code Here

        {
            return;
        }
        if ( basedir.exists() )
        {
            AccuRevInfo bdInfo = accurevCL.info( basedir );
            if ( bdInfo.isWorkSpaceTop() )
            {
                accurevCL.promoteAll( basedir, "clear default group" );
                accurevCL.rmws( bdInfo.getWorkSpace() );
            }
        }
    }
View Full Code Here

        if ( fileList.isEmpty() )
        {
            // TODO the above test will be matched by a fileset where excludes and includes produce a set with no files.
            // This is
            // NOT the same as a fileset created with only a base directory. Raise maven-scm JIRA for this.
            AccuRevInfo info = accuRev.info( basedir );

            if ( repository.isWorkSpaceRoot( info ) )
            {
                promotedFiles = accuRev.promoteAll( basedir, message );
            }
View Full Code Here

        throws AccuRevException
    {

        setWorkingDirectory( basedir );
        String[] info = { "info" };
        AccuRevInfo result = new AccuRevInfo( basedir );

        executeCommandLine( info, null, new InfoConsumer( result ) );
        return result;
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.provider.accurev.AccuRevInfo

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.