Examples of UpdateScmResult


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

            ScmRepository repository = getScmRepository();

            ScmProvider scmProvider = scmManager.getProviderByRepository( repository );

            String branch = getScmBranch();
            UpdateScmResult result;
            if (!branch.equals(DEFAULT_BRANCH_NAME)) {
              getLog().debug("Updating from branch: " + branch);
              result = scmProvider.update( repository, new ScmFileSet( scmDirectory ), new ScmBranch( branch ) );
            } else {
              getLog().debug("Updating from provider's chosen tag/branch/revision");
              result = scmProvider.update( repository, new ScmFileSet( scmDirectory ) );
            }
           
            checkResult( result );

            if ( scmProvider instanceof AbstractSvnScmProvider )
            {
                String revision = ( (UpdateScmResultWithRevision) result ).getRevision();
                getLog().info( "Got a revision during update: " + revision );
                this.revision = revision;
            }

            return result.getUpdatedFiles();
        }
        catch ( ScmException e )
        {
            throw new MojoExecutionException( "Couldn't update project. " + e.getMessage(), 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

    {
        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 );

            List<Project> projectsWithCommonScmRoot = getListOfProjectsInGroupWithCommonScmRoot( context );
            String projectScmRootUrl = getProjectScmRootUrl( context, project.getScmUrl() );

            // TODO: not sure why this is different to the context, but it all needs to change
            File workingDirectory = workingDirectoryService.getWorkingDirectory( project, projectScmRootUrl,
                                                                                 projectsWithCommonScmRoot );

            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory, projectScmRootUrl );
            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

    public void execute( Map context )
        throws Exception
    {
        Project project = ContinuumBuildAgentUtil.getProject( context );

        UpdateScmResult scmResult;

        ScmResult result;

        try
        {
            File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
            ContinuumScmConfiguration config = createScmConfiguration( project, workingDirectory );
            config.setLatestUpdateDate( ContinuumBuildAgentUtil.getLatestUpdateDate( context ) );
            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

        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() );
        ScmFileSet workingDirSet = new ScmFileSet( workingDirectory );

        try
        {
            if ( !workingDirectory.exists() )
            {
                workingDirectory.mkdirs();
            }

            ScmVersion scmTag = null;

            ScmProviderRepository providerRepo = repository.getProviderRepository();

            // FIXME: This should be handled by the maven-scm git provider
            if ( providerRepo instanceof GitScmProviderRepository )
            {
                String branchName = GitBranchCommand.getCurrentBranch( new PlexusLogger( getLogger() ),
                                                                       (GitScmProviderRepository) providerRepo,
                                                                       workingDirSet );
                scmTag = new ScmBranch( branchName );
            }

            if ( workingDirectory.listFiles().length > 1 )
            {
                updateScmResult = provider.update( repository, workingDirSet, scmTag );
            }
            else
            {
                checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory ) );
                checkOutScmResult = provider.checkOut( repository, workingDirSet, scmTag );
            }
        }
        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

        try
        {
            ScmRepository repository = getScmRepository();

            UpdateScmResult result = getScmManager().update( repository, getFileSet(),
                                                             getScmVersion( scmVersionType, scmVersion ),
                                                             runChangelog );

            checkResult( result );
View Full Code Here

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

        try
        {
            ScmRepository repository = getScmRepository();

            UpdateScmResult result =
                getScmManager().update( repository, getFileSet(), getScmVersion( scmVersionType, scmVersion ) );

            checkResult( result );

            if ( result instanceof UpdateScmResultWithRevision )
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( "Error while executing command.", ex );
        }

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

        UpdateScmResultWithRevision result = new UpdateScmResultWithRevision( cl.toString(), consumer.getUpdatedFiles(),
                                                String.valueOf( consumer.getRevision() ) );
       
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.