Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmResult


    {

        List<String> errorMessages = new ArrayList<String>();

        String[] checkCmd = new String[]{BazaarConstants.CHECK, scmSpecificUrl};
        ScmResult result;
        try
        {
            File tmpDir = new File( System.getProperty( "java.io.tmpdir" ) );
            result = BazaarUtils.execute( tmpDir, checkCmd );
            if ( !result.isSuccess() )
            {
                errorMessages.add( result.getCommandOutput() );
                errorMessages.add( result.getProviderMessage() );
            }
        }
        catch ( ScmException e )
        {
            errorMessages.add( e.getMessage() );
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

    {

        File workingDir = fileSet.getBasedir();
        BazaarStatusConsumer consumer = new BazaarStatusConsumer( getLogger(), workingDir );
        String[] statusCmd = new String[] { BazaarConstants.STATUS_CMD };
        ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, statusCmd );

        return new StatusScmResult( consumer.getStatus(), result );
    }
View Full Code Here

                             (String[]) checkoutCmd.toArray( new String[0] ) );

        // Do inventory to find list of checkedout files
        String[] inventoryCmd = new String[]{BazaarConstants.INVENTORY_CMD};
        BazaarCheckOutConsumer consumer = new BazaarCheckOutConsumer( getLogger(), checkoutDir );
        ScmResult result = BazaarUtils.execute( consumer, getLogger(), checkoutDir, inventoryCmd );
        if ( !result.isSuccess() )
        {
            throw new ScmException( result.getProviderMessage() );
        }
        return new CheckOutScmResult( consumer.getCheckedOutFiles(), result );
    }
View Full Code Here

        BazaarUtils.expandCommandLine( command, fileSet );

        File workingDir = fileSet.getBasedir();
        BazaarRemoveConsumer consumer = new BazaarRemoveConsumer( getLogger(), workingDir );

        ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, command );
        return new RemoveScmResult( consumer.getRemovedFiles(), result );
    }
View Full Code Here

       
        // Perform the tagging operation
        File bazaarRoot = fileSet.getBasedir();
        BazaarConsumer consumer = new BazaarConsumer( getLogger() );
        String[] tagCmd = new String[] { BazaarConstants.TAG_CMD, tagName };
        ScmResult tagResult = BazaarUtils.execute( consumer, getLogger(), bazaarRoot, tagCmd );
        if ( !tagResult.isSuccess() ) {
            return new TagScmResult( null, tagResult );
        }

        // Do "bzr ls -R -r tag:tagName" to get a list of the tagged files
        BazaarLsConsumer lsConsumer =
            new BazaarLsConsumer( getLogger(), bazaarRoot, ScmFileStatus.TAGGED );
        String[] lsCmd = new String[] {
                                       BazaarConstants.LS_CMD,
                                       BazaarConstants.RECURSIVE_OPTION,
                                       BazaarConstants.REVISION_OPTION,
                                       "tag:" + tagName
                                       };
        ScmResult lsResult = BazaarUtils.execute(lsConsumer, getLogger(), bazaarRoot, lsCmd);
        if ( !lsResult.isSuccess() ) {
            return new TagScmResult( null, lsResult );
        }
       
        // Push new tags to parent branch if any
        BazaarScmProviderRepository bazaarRepository = (BazaarScmProviderRepository) repository;
        if ( !bazaarRepository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) && repository.isPushChanges() )
        {
            String[] pushCmd = new String[] { BazaarConstants.PUSH_CMD, bazaarRepository.getURI() };
            ScmResult pushResult =
                BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), pushCmd );
            if ( !pushResult.isSuccess() ) {
                return new TagScmResult( null, pushResult );
            }
        }
       
        return new TagScmResult( lsConsumer.getListedFiles(), tagResult );
View Full Code Here

        //Add to repository
        String[] add_cmd = new String[] { BazaarConstants.ADD_CMD };
        ScmFileSet filesToAdd = new ScmFileSet( new File( "" ), files );
        add_cmd = BazaarUtils.expandCommandLine( add_cmd, filesToAdd );
        ScmResult result = BazaarUtils.execute( WORKING_DIR, add_cmd );
        if ( !result.isSuccess() )
        {
            String message =
                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
            throw new Exception( message );
        }

        // Commit the initial repository
        String[] commit_cmd = new String[]{BazaarConstants.COMMIT_CMD, BazaarConstants.MESSAGE_OPTION, COMMIT_MESSAGE};
        result = BazaarUtils.execute( WORKING_DIR, commit_cmd );
        if ( !result.isSuccess() )
        {
            String message =
                "Provider message: " + result.getProviderMessage() + "\n" + "Output: " + result.getCommandOutput();
            throw new Exception( message );
        }
    }
View Full Code Here

            createCreateWorkspaceFromSnapshotCommand( jazzRepo, fileSet, nameWorkspace, nameSnapshot );
        int status = tckCreateWorkspaceFromSnapshotCmd.execute( tckConsumer, errConsumer );

        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new ScmResult( tckCreateWorkspaceFromSnapshotCmd.getCommandString(),
                                  "Error code for Jazz SCM (create workspace --snapshot) command - " + status,
                                  errConsumer.getOutput(), false );
        }

        return new ScmResult( tckCreateWorkspaceFromSnapshotCmd.getCommandString(), "All ok",
                              ( (DebugLoggerConsumer) tckConsumer ).getOutput(), true );
    }
View Full Code Here

        if ( getLogger().isDebugEnabled() )
        {
            getLogger().debug( "checkout command end successfully ..." );
        }

        return new CheckOutScmResult( files, new ScmResult( "multiple commandline", "OK", "OK", true ) );
    }
View Full Code Here

        super.execute();

        if ( this.getCheckoutResult() != null )
        {
           
            ScmResult checkoutResult = this.getCheckoutResult();
           
            //At the time of useExport feature is requested only SVN and and CVS have export command implemented
            // we will deal with this as more user using this feature specially clearcase where we need to
            // add relativePathProjectDirectory support to ExportScmResult
            String relativePathProjectDirectory = "";
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.