Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmResult


                    throw new ScmException(
                        "Unable to add file to SCM: " + scmFile + "; see error messages above for more information" );
                }
            }

            ScmResult result =
                scmProvider.checkIn( scmRepository, new ScmFileSet( checkoutDirectory ), makeScmVersion(), msg );

            checkScmResult( result );
        }
        catch ( ScmException e )
View Full Code Here


        dateInterval.append( dateFormat.format( endDate == null ? new Date() : endDate ) ); // Upto now

        String[] cmd = new String[]{ HgCommandConstants.LOG_CMD, HgCommandConstants.VERBOSE_OPTION,
            HgCommandConstants.NO_MERGES_OPTION, HgCommandConstants.DATE_OPTION, dateInterval.toString() };
        HgChangeLogConsumer consumer = new HgChangeLogConsumer( getLogger(), datePattern );
        ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd );

        List<ChangeSet> logEntries = consumer.getModifications();
        ChangeLogSet changeLogSet = new ChangeLogSet( logEntries, startDate, endDate );
        return new ChangeLogScmResult( changeLogSet, result );
    }
View Full Code Here

        }

        String[] cmd = new String[]{ HgCommandConstants.LOG_CMD, HgCommandConstants.VERBOSE_OPTION,
            HgCommandConstants.NO_MERGES_OPTION, HgCommandConstants.REVISION_OPTION, revisionInterval.toString() };
        HgChangeLogConsumer consumer = new HgChangeLogConsumer( getLogger(), datePattern );
        ScmResult result = HgUtils.execute( consumer, getLogger(), fileSet.getBasedir(), cmd );

        List<ChangeSet> logEntries = consumer.getModifications();
        Date startDate = null;
        Date endDate = null;
        if ( !logEntries.isEmpty() )
View Full Code Here

                {
                    logger.error( providerMsg );
                }
            }

            return new ScmResult( cmd.toString(), providerMsg, consumer.getStdErr(), success );
        }
        catch ( ScmException se )
        {
            String msg =
                "EXECUTION FAILED" + "\n  Execution failed before invoking the Hg command. Last exception:" + "\n    " +
View Full Code Here

    public static boolean differentOutgoingBranchFound( ScmLogger logger, File workingDir, String workingbranchName )
        throws ScmException
    {
        String[] outCmd = new String[]{ HgCommandConstants.OUTGOING_CMD };
        HgOutgoingConsumer outConsumer = new HgOutgoingConsumer( logger );
        ScmResult outResult = HgUtils.execute( outConsumer, logger, workingDir, outCmd );
        List<HgChangeSet> changes = outConsumer.getChanges();
        if ( outResult.isSuccess() )
        {
            for ( int i = 0; i < changes.size(); i++ )
            {
                HgChangeSet set = changes.get( i );
                if ( set.getBranch() != null )
View Full Code Here

                {
                    logger.error( providerMsg );
                }
            }

            return new ScmResult( cmd.toString(), providerMsg, consumer.getStdErr(), success );
        }
        catch ( ScmException se )
        {
            String msg =
                "EXECUTION FAILED" + "\n  Execution failed before invoking the Hg command. Last exception:" + "\n    "
View Full Code Here

    public static boolean differentOutgoingBranchFound( ScmLogger logger, File workingDir, String workingbranchName )
        throws ScmException
    {
        String[] outCmd = new String[]{ HgCommandConstants.OUTGOING_CMD };
        HgOutgoingConsumer outConsumer = new HgOutgoingConsumer( logger );
        ScmResult outResult = HgUtils.execute( outConsumer, logger, workingDir, outCmd );
        List<HgChangeSet> changes = outConsumer.getChanges();
        if ( outResult.isSuccess() )
        {
            for ( HgChangeSet set : changes )
            {
                if ( set.getBranch() != null )
                {
View Full Code Here

                {
                    logger.error( providerMsg );
                }
            }

            return new ScmResult( cmd.toString(), providerMsg, consumer.getStdErr(), success );
        }
        catch ( ScmException se )
        {
            String msg =
                "EXECUTION FAILED\n  Execution failed before invoking the Bazaar command. Last exception:"
View Full Code Here

            cmd.add( BazaarConstants.LIMIT_OPTION );
            cmd.add( Integer.toString( limit ) );
        }

        BazaarChangeLogConsumer consumer = new BazaarChangeLogConsumer( getLogger(), datePattern );
        ScmResult result = BazaarUtils.execute( consumer, getLogger(), fileSet.getBasedir(),
            cmd.toArray( new String[cmd.size()] ) );

        List<ChangeSet> logEntries = consumer.getModifications();
        List<ChangeSet> inRangeAndValid = new ArrayList<ChangeSet>();
        startDate = startDate == null ? new Date( 0 ) : startDate; //From 1. Jan 1970
View Full Code Here

                tag };

        // keep the command about in string form for reporting
        StringBuilder cmd = joinCmd( tagCmd );
        HgTagConsumer consumer = new HgTagConsumer( getLogger() );
        ScmResult result = HgUtils.execute( consumer, getLogger(), workingDir, tagCmd );
        HgScmProviderRepository repository = (HgScmProviderRepository) scmProviderRepository;
        if ( result.isSuccess() )
        {
            // now push
            // Push to parent branch if any

            if ( repository.isPushChanges() )
            {
                if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) )
                {
                    String branchName = HgUtils.getCurrentBranchName( getLogger(), workingDir );
                    boolean differentOutgoingBranch =
                        HgUtils.differentOutgoingBranchFound( getLogger(), workingDir, branchName );

                    String[] pushCmd = new String[]{ HgCommandConstants.PUSH_CMD,
                        differentOutgoingBranch ? HgCommandConstants.REVISION_OPTION + branchName : null,
                        repository.getURI() };

                    result =
                        HgUtils.execute( new HgConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd );
                }
            }
        }
        else
        {
            throw new ScmException( "Error while executing command " + cmd.toString() );
        }

        // do an inventory to return the files tagged (all of them)
        String[] listCmd = new String[]{ HgCommandConstants.INVENTORY_CMD };
        HgListConsumer listconsumer = new HgListConsumer( getLogger() );
        result = HgUtils.execute( listconsumer, getLogger(), fileSet.getBasedir(), listCmd );
        if ( result.isSuccess() )
        {
            List<ScmFile> files = listconsumer.getFiles();
            List<ScmFile> fileList = new ArrayList<ScmFile>();
            for ( ScmFile f : files )
            {
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.ScmResult

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.