Examples of UpdateScmResult


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 cvs command failed.", stderr.getOutput(), false );
        }

        return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() );
    }
View Full Code Here

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

        ScmResult updateResult = BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), workingDir,
                                                      updateCmd );

        if ( !updateResult.isSuccess() )
        {
            return new UpdateScmResult( null, null, updateResult );
        }

        // Find changes from last revision
        int currentRevision = BazaarUtils.getCurrentRevisionNumber( getLogger(), workingDir );
        int previousRevision = currentRevision - 1;
View Full Code Here

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

        Commandline clRev = createLatestRevisionCommandLine( repository, fileSet.getBasedir(), scmVersion );
        GitLatestRevisionCommandConsumer consumerRev = new GitLatestRevisionCommandConsumer( getLogger() );
        exitCode = GitCommandLineUtils.execute( clRev, consumerRev, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new UpdateScmResult( clRev.toString(), "The git-log command failed.",
                    stderr.getOutput(), false );
        }
        String origSha1 = consumerRev.getLatestRevision();

        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), scmVersion );
        exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new UpdateScmResult( cl.toString(), "The git-pull command failed.",
                                        stderr.getOutput(), false );
        }

        // we also need to log exactly what has been updated
        GitDiffRawConsumer diffRawConsumer = new GitDiffRawConsumer( getLogger() );
        Commandline clDiffRaw = GitDiffCommand.createDiffRawCommandLine( fileSet.getBasedir(), origSha1 );
        exitCode = GitCommandLineUtils.execute( clDiffRaw, diffRawConsumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new UpdateScmResult( clDiffRaw.toString(), "The git-diff --raw command failed.",
                    stderr.getOutput(), false );
        }

       
        // now let's get the latest version
        consumerRev = new GitLatestRevisionCommandConsumer( getLogger() );
        exitCode = GitCommandLineUtils.execute( clRev, consumerRev, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new UpdateScmResult( clRev.toString(), "The git-log command failed.",
                                        stderr.getOutput(), false );
        }
        String latestRevision = consumerRev.getLatestRevision();
       
        return new UpdateScmResultWithRevision( cl.toString(), diffRawConsumer.getChangedFiles(), latestRevision );
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

            throw new ScmException( "Error while executing clearcase command.", ex );
        }

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

        return new UpdateScmResult( cl.toString(), consumer.getUpdatedFiles() );
    }
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

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

    {
        Project project = ContinuumBuildAgentUtil.getProject( context );

        BuildDefinition buildDefinition = ContinuumBuildAgentUtil.getBuildDefinition( context );

        UpdateScmResult scmResult;

        ScmResult result;
       
        try
        {
            // TODO: not sure why this is different to the context, but it all needs to change
            File workingDirectory = buildAgentConfigurationService.getWorkingDirectory( project.getId() );
            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

        //project.setState( ContinuumProjectState.UPDATING );

        //projectDao.updateProject( project );

        UpdateScmResult scmResult;

        ScmResult result;

        Date latestUpdateDate = null;

        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
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.