Examples of UpdateScmResult


Examples of org.apache.maven.scm.command.update.UpdateScmResult

        JazzScmCommand updateCmd = createAcceptCommand( repo, fileSet );
        int status = updateCmd.execute( updateConsumer, err );

        if ( status != 0 || err.hasBeenFed() )
        {
            return new UpdateScmResult( updateCmd.getCommandString(),
                                        "Error code for Jazz SCM update command - " + status, err.getOutput(), false );
        }

        if ( getLogger().isDebugEnabled() )
        {
            Iterator<ScmFile> iter = updateConsumer.getUpdatedFiles().iterator();
            if ( iter.hasNext() )
            {
                getLogger().debug( "Iterating over \"Update\" results" );
                while ( iter.hasNext() )
                {
                    ScmFile file = (ScmFile) iter.next();
                    getLogger().debug( file.getPath() + " : " + file.getStatus() );
                }
            }
            else
            {
                getLogger().debug( "There are no updated files" );
            }
        }

        // Now, just (re)load the workspace into the sand box.
        // We can use the checkout directory for this.
        return new UpdateScmResult( updateCmd.getCommandString(), updateConsumer.getUpdatedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        setExportScmResult( new ExportScmResult( "", "", "", true ) );
        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
        setUnEditScmResult( new UnEditScmResult( "", "", "", true ) );
        setUpdateScmResult( new UpdateScmResult( "", "", "", true ) );
        setBlameScmResult( new BlameScmResult( "", "", "", true ) );
        setMkdirScmResult( new MkdirScmResult( "", "", "", true ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

    {
        Project project = projectDao.getProject( getProject( context ).getId() );

        BuildDefinition buildDefinition = getBuildDefinition( context );

        UpdateScmResult scmResult;

        ScmResult result;

        Date latestUpdateDate = null;

        int originalState = project.getState();

        project.setState( ContinuumProjectState.UPDATING );

        projectDao.updateProject( project );

        try
        {
            BuildResult buildResult = buildResultDao.getLatestBuildResultForProject( project.getId() );

            latestUpdateDate = new Date( buildResult.getStartTime() );
        }
        catch ( Exception e )
        {
        }

        try
        {
            notifier.checkoutStarted( project, buildDefinition );

            // TODO: not sure why this is different to the context, but it all needs to change
            File workingDirectory = workingDirectoryService.getWorkingDirectory( project );
            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
            config.setLatestUpdateDate( latestUpdateDate );
            String tag = config.getTag();
            String msg =
                project.getName() + "', id: '" + project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" +
                    ( tag != null ? " with branch/tag " + tag + "." : "." );
            getLogger().info( "Updating project: " + msg );
            scmResult = scm.update( config );

            if ( !scmResult.isSuccess() )
            {
                getLogger().warn( "Error while updating the code for project: '" + msg );

                getLogger().warn( "Command output: " + scmResult.getCommandOutput() );

                getLogger().warn( "Provider message: " + scmResult.getProviderMessage() );
            }

            if ( scmResult.getUpdatedFiles() != null && scmResult.getUpdatedFiles().size() > 0 )
            {
                getLogger().info( "Updated " + scmResult.getUpdatedFiles().size() + " files." );
            }

            result = convertScmResult( scmResult );
        }
        catch ( ScmRepositoryException e )
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

            // Remove the clientspec name, so it will be recalculated between each command for each project
            // instead of use the same for all projects
            System.setProperty( "maven.scm.starteam.deleteLocal", "true" );
        }

        UpdateScmResult result;

        ScmFileSet fileSet = new ScmFileSet( workingDirectory );

        // TODO: shouldn't need to synchronize this
        synchronized ( this )
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        catch ( NoSuchScmProviderException e )
        {
            throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
        }

        UpdateScmResult updateScmResult = null;
        CheckOutScmResult checkOutScmResult = null;
       
        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
       
        try
        {
            if ( !workingDirectory.exists() )
            {
                workingDirectory.mkdirs();
            }
           
            if( workingDirectory.listFiles().length > 1 )
            {
                updateScmResult = provider.update( repository, new ScmFileSet( workingDirectory ), (ScmVersion) null );
            }
            else
            {
                checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory ) );
            }
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error occurred while updating your local copy: " + e.getMessage(),
                                                 e );
        }

        if ( updateScmResult != null )
        {
            if( !updateScmResult.isSuccess() )
            {
                throw new ReleaseScmCommandException( "Unable to update current working copy", updateScmResult );
            }
           
            copyUpdated = updateScmResult.getUpdatedFiles().size() > 0;
        }
        else
        {
            if( !checkOutScmResult.isSuccess() )
            {
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        params.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );

        CheckOutScmResult cosr = (CheckOutScmResult) command.execute( repo, files, params );
        if ( !cosr.isSuccess() )
        {
            return new UpdateScmResult( cosr.getCommandLine(), cosr.getProviderMessage(), cosr.getCommandOutput(),
                                        false );
        }

        PerforceScmProviderRepository p4repo = (PerforceScmProviderRepository) repo;
        String clientspec = PerforceScmProvider.getClientspecName( getLogger(), p4repo, files.getBasedir() );
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

        setExportScmResult( new ExportScmResult( "", "", "", true ) );
        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
        setTagScmResult( new TagScmResult( "", "", "", true ) );
        setUnEditScmResult( new UnEditScmResult( "", "", "", true ) );
        setUpdateScmResult( new UpdateScmResult( "", "", "", true ) );
        setBlameScmResult( new BlameScmResult( "", "", "", true ) );
        setMkdirScmResult( new MkdirScmResult( "", "", "", true ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

                + "'." );

            return;
        }

        UpdateScmResult result = scmManager.update( scmRepository, new ScmFileSet( workingDirectory ), version );

        if ( !result.isSuccess() )
        {
            showError( result );

            return;
        }

        List<ScmFile> updatedFiles = result.getUpdatedFiles();

        System.out.println( "Updated these files: " );

        for ( ScmFile file : updatedFiles )
        {
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

       
        // ----------------------------------------------------------------------
        // Update the project
        // ----------------------------------------------------------------------
      
        UpdateScmResult result = scmManager.update( repository, new ScmFileSet( getUpdatingCopy() ), lastUpdate );

        assertNotNull( "The command returned a null result.", result );

        assertResultIsSuccess( result );

        List<ScmFile> updatedFiles = result.getUpdatedFiles();

        List<ChangeSet> changedSets = result.getChanges();

        assertEquals( "Expected 3 files in the updated files list " + updatedFiles, 3, updatedFiles.size() );

        assertNotNull( "The changed files list is null", changedSets );
View Full Code Here

Examples of org.apache.maven.scm.command.update.UpdateScmResult

            {
                throw new ScmException( "Unable to copy directory structure", e1 );
            }
        }

        return new UpdateScmResult( "ccm reconcile -uwa ...", modifications );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.