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
        {
            File path = new File( repository.getDepotRelativeProjectPath() );
            return accuRev.popExternal( basedir, basisStream, transactionId, Collections.singletonList( path ) );
        }
        finally
        {
            if ( removedWorkspace )
            {
                accuRev.reactivate( info.getWorkSpace() );
            }
        }
    }
View Full Code Here


    protected List<File> extractSource( AccuRevScmProviderRepository repository, File basedir, AccuRevVersion version )
        throws AccuRevException
    {
        AccuRev accuRev = repository.getAccuRev();

        AccuRevInfo info = accuRev.info( basedir );

        List<File> extractedFiles = new ArrayList<File>();
       
        String basisStream = version.getBasisStream();
        String transactionId = version.getTimeSpec();

        boolean success = true;
        if ( info.isWorkSpace() )
        {

            if ( !repository.isWorkSpaceTop( info ) )
            {
                throw new AccuRevException( String.format( "Can't checkout to %s, "
                    + "a subdirectory of existing workspace %s", basedir, info.getWorkSpace() ) );
            }
            // workspace exists at this basedir already.
            if ( !basisStream.equals( info.getBasis() ) )
            {
                // different basis, reparent.
                success = accuRev.chws( basedir, info.getWorkSpace(), basisStream );
            }

            if ( success )
            {
                // repopulate everything in the workspace.
View Full Code Here

        snapshotName = repository.getSnapshotName( snapshotName );

        File basedir = fileSet.getBasedir();
        boolean success = true;

        AccuRevInfo info = accuRev.info( basedir );
        List<File> taggedFiles = null;

        success = accuRev.mksnap( snapshotName, info.getBasis() );
        if ( success )
        {
            taggedFiles = accuRev.statTag( snapshotName );
        }
View Full Code Here

                                               CommandParameters parameters )
        throws ScmException, AccuRevException
    {
        boolean result = false;
        AccuRev accurev = repository.getAccuRev();
        AccuRevInfo info = accurev.info( null );

        String providerMessage = "";
        if ( info == null )
        {
            providerMessage = "Unable to retrieve accurev info";
        }
        else if ( repository.getUser() != null )
        {
            // Check if we've already logged in as this user
            result = repository.getUser().equals( info.getUser() );
            if ( result )
            {
                providerMessage = "Skipping login - already logged in as " + repository.getUser();
            }
            else
            {
                result = accurev.login( repository.getUser(), repository.getPassword() );
                providerMessage = ( result ? "Success" : "Failure" ) + " logging in as " + repository.getUser();
            }
        }
        else
        {
            result = info.isLoggedIn();
            providerMessage = result ? ( "Logged in externally as " + info.getUser() ) : "Not logged in";
        }

        getLogger().debug( providerMessage );
        return new LoginScmResult( accurev.getCommandLines(), providerMessage, accurev.getErrorOutput(), result );
View Full Code Here

        AccuRev accuRev = repository.getAccuRev();

        File basedir = fileSet.getBasedir();

        AccuRevInfo info = accuRev.info( basedir );

        if ( !info.isWorkSpace() )
        {
            throw new AccuRevException( "No workspace at " + basedir.getAbsolutePath() );
        }

        String startRevision = getStartRevision( repository, parameters, info );

        ScmVersion scmVersion = parameters.getScmVersion( CommandParameter.SCM_VERSION, null );

        String updateTransactionId = null;

        if ( scmVersion != null )
        {
            AccuRevVersion updateVersion = repository.getAccuRevVersion( scmVersion );

            // Reparent if necessary
            String newBasisStream = updateVersion.getBasisStream();
            if ( newBasisStream != null
                && ( !( newBasisStream.equals( info.getWorkSpace() ) || newBasisStream.equals( info.getBasis() ) ) ) )
            {
                getLogger().info( "Reparenting " + info.getWorkSpace() + " to " + newBasisStream );
                accuRev.chws( basedir, info.getWorkSpace(), newBasisStream );
            }

            if ( !updateVersion.isNow() )
            {
                updateTransactionId = updateVersion.getTimeSpec();
            }
        }

        if ( updateTransactionId == null )
        {
            updateTransactionId = repository.getDepotTransactionId( info.getWorkSpace(), "now" );
        }

        String endRevision = repository.getRevision( info.getWorkSpace(), updateTransactionId );

        List<File> updatedFiles = accuRev.update( basedir, updateTransactionId );

        if ( updatedFiles != null )
        {
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

        {
            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

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.