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

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


                                               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


    {
        // Setup test data so that the checkin area is the repo's project path.
        final ScmFileSet testFileSet = new ScmFileSet( new File( basedir, "project/dir" ) );
        final File basedir = testFileSet.getBasedir();

        final AccuRevInfo info = new AccuRevInfo( basedir );
        info.setTop( basedir.getAbsolutePath() );

        when( accurev.info( basedir ) ).thenReturn( info );

        List<File> promotedFiles = Arrays.asList( new File( "kept/file" ), new File( "promoted/file" ) );
        when( accurev.promoteAll( basedir, "A commit message" ) ).thenReturn( promotedFiles );
View Full Code Here

    {
        // Setup test data so that the checkin area is the repo's project path.
        final ScmFileSet testFileSet = new ScmFileSet( new File( basedir, "project/dir" ) );
        final File basedir = testFileSet.getBasedir();

        final AccuRevInfo info = new AccuRevInfo( basedir );
        info.setTop( basedir.getAbsolutePath() );

        when( accurev.info( basedir ) ).thenReturn( info );

        when( accurev.promoteAll( basedir, "A commit message" ) ).thenReturn( null );
View Full Code Here

    @Test( expected = ScmException.class )
    public void testCheckinRecursiveSubDirectoryNotSupported()
        throws AccuRevException, ScmException
    {
        final ScmFileSet testFileSet = new ScmFileSet( basedir );
        final AccuRevInfo info = new AccuRevInfo( basedir );
        info.setTop( basedir.getParent() );

        // TODO test basedir is top + project path. is OK.
        when( accurev.info( basedir ) ).thenReturn( info );

        AccuRevCheckInCommand command = new AccuRevCheckInCommand( getLogger() );
View Full Code Here

    {
        final ScmFileSet testFileSet = new ScmFileSet( new File( "/my/workspace/project/dir" ) );
        final File basedir = testFileSet.getBasedir();

        final String basisStream = "basisStream";
        final AccuRevInfo info = new AccuRevInfo( basedir );
        info.setBasis( basisStream );

        AccuRevScmProviderRepository repo = new AccuRevScmProviderRepository();
        repo.setStreamName( "myStream" );
        repo.setAccuRev( accurev );
        repo.setProjectPath( "/project/dir" );
View Full Code Here

    {
        final ScmFileSet testFileSet = new ScmFileSet( new File( "/my/workspace/project/dir" ) );
        final File basedir = testFileSet.getBasedir();

        final String basisStream = "basisStream";
        final AccuRevInfo info = new AccuRevInfo( basedir );
        info.setBasis( basisStream );

        AccuRevScmProviderRepository repo = new AccuRevScmProviderRepository();
        repo.setStreamName( "myStream" );
        repo.setAccuRev( accurev );
        repo.setProjectPath( "/project/dir" );
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

    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

        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

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.