Package org.apache.maven.scm.command.update

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


            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

            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

        try
        {
            ScmRepository repository = getScmRepository();

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

            checkResult( result );
View Full Code Here

        }
        ScmResult updateResult = HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), workingDir, updateCmd );

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

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

        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

        try
        {
            ScmRepository repository = getScmRepository();

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

            checkResult( result );

            if ( result instanceof UpdateScmResultWithRevision )
View Full Code Here

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

            if ( exitCode != 0 )
            {
                return new UpdateScmResult( cl.toString(), "The starteam command failed.", stderr.getOutput(), false );
            }
            else
            {
                //hiden feature to allow Continuous Integration machine to
                // delete local files. It affectively remove all build ouput as well
                String doDeleteLocal = System.getProperty( "maven.scm.starteam.deleteLocal" );

                if ( "true".equalsIgnoreCase( doDeleteLocal ) )
                {
                    this.deleteLocal( repository, fileSet, version );
                }
            }
        }
        else
        {
            //update only interested files already on the local disk
            for ( int i = 0; i < updateFiles.size(); ++i )
            {
                File updateFile = (File) updateFiles.get( i );
                ScmFileSet scmFileSet = new ScmFileSet( fileSet.getBasedir(), updateFile );
                Commandline cl = createCommandLine( repository, scmFileSet, version );

                int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

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

        return new UpdateScmResult( null, consumer.getCheckedOutFiles() );

    }
View Full Code Here

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

        {
            if ( getLogger().isWarnEnabled() )
            {
                getLogger().warn( "failed to update git, return code " + exitCode );
            }
            return new UpdateScmResult( cl.toString(), "The git-pull command failed.",
                                        stderr.getOutput(), false );
        }
       
        // now let's get the latest version
        Commandline clRev = createLatestRevisionCommandLine( repository, fileSet.getBasedir(), scmVersion );
        GitLatestRevisionCommandConsumer consumerRev = new GitLatestRevisionCommandConsumer( getLogger() );
        exitCode = GitCommandLineUtils.execute( clRev, consumerRev, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            if ( getLogger().isWarnEnabled() )
            {
                getLogger().warn( "failed to update git, return code " + exitCode );
            }
            return new UpdateScmResult( cl.toString(), "The git-log command failed.",
                                        stderr.getOutput(), false );
        }
        String latestRevision = consumerRev.getLatestRevision();
       
        return new UpdateScmResultWithRevision( cl.toString(), consumer.getUpdatedFiles(), latestRevision );
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.update.UpdateScmResult

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.