Package org.apache.maven.scm

Examples of org.apache.maven.scm.ScmResult


    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


        }

        diffCmd = BazaarUtils.expandCommandLine( diffCmd, fileSet );
        BazaarDiffConsumer consumer = new BazaarDiffConsumer( getLogger(), fileSet.getBasedir() );

        ScmResult result = BazaarUtils.execute( consumer, getLogger(), fileSet.getBasedir(), diffCmd );

        return new DiffScmResult( consumer.getChangedFiles(), consumer.getDifferences(), consumer.getPatch(), result );
    }
View Full Code Here

        File workingDir = fileSet.getBasedir();

        // Update branch
        String[] updateCmd = new String[] { BazaarConstants.PULL_CMD };
        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;
        String[] diffCmd =
            new String[] { BazaarConstants.DIFF_CMD, BazaarConstants.REVISION_OPTION, "" + previousRevision };
        BazaarDiffConsumer diffConsumer = new BazaarDiffConsumer( getLogger(), workingDir );
        ScmResult diffResult = BazaarUtils.execute( diffConsumer, getLogger(), workingDir, diffCmd );

        // Now translate between diff and update file status
        List<ScmFile> updatedFiles = new ArrayList<ScmFile>();
        List<CharSequence> changes = new ArrayList<CharSequence>();
        List<ScmFile> diffFiles = diffConsumer.getChangedFiles();
View Full Code Here

    {
        String[] cmd = new String[]{BLAME_CMD, "--all"// Show annotations on all lines
            "--long", // Show commit date in annotations
            filename};
        BazaarBlameConsumer consumer = new BazaarBlameConsumer( getLogger() );
        ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDirectory.getBasedir(), cmd );
        return new BlameScmResult( consumer.getLines(), result );
    }
View Full Code Here

        String[] addCmd = new String[]{BazaarConstants.ADD_CMD, BazaarConstants.NO_RECURSE_OPTION};
        addCmd = BazaarUtils.expandCommandLine( addCmd, fileSet );

        File workingDir = fileSet.getBasedir();
        BazaarAddConsumer consumer = new BazaarAddConsumer( getLogger(), workingDir );
        ScmResult result = BazaarUtils.execute( consumer, getLogger(), workingDir, addCmd );

        return new AddScmResult( consumer.getAddedFiles(), result );
    }
View Full Code Here

        }

        // Commit to local branch
        String[] commitCmd = new String[]{BazaarConstants.COMMIT_CMD, BazaarConstants.MESSAGE_OPTION, message};
        commitCmd = BazaarUtils.expandCommandLine( commitCmd, fileSet );
        ScmResult result =
            BazaarUtils.execute( new BazaarConsumer( getLogger() ), getLogger(), fileSet.getBasedir(), commitCmd );

        // Push to parent branch if any
        BazaarScmProviderRepository repository = (BazaarScmProviderRepository) repo;
        if ( !repository.getURI().equals( fileSet.getBasedir().getAbsolutePath() ) && repo.isPushChanges() )
View Full Code Here

        // just invoke add command
        Command cmd = getAddCommand();
        cmd.setLogger( getLogger() );

        ScmResult addResult = cmd.execute( repository, fileSet, parameters );

        if ( !addResult.isSuccess() )
        {
            return new MkdirScmResult( addResult.getCommandLine().toString(), "The cvs command failed.",
                                       addResult.getCommandOutput(), false );
        }
       
        List<ScmFile> addedFiles = new ArrayList<ScmFile>();
       
        for (File file : fileSet.getFileList())
        {
            ScmFile scmFile = new ScmFile( file.getPath(), ScmFileStatus.ADDED );
            addedFiles.add( scmFile );
        }

        return new MkdirScmResult( addResult.getCommandLine().toString(), addedFiles );
    }
View Full Code Here

            return new CheckInScmResult( "si ci/drop", changedFiles );
        }
        else
        {
            return new CheckInScmResult( changedFiles,
                                         new ScmResult( "si ci/drop", "There was a problem updating the repository", "",
                                                        false ) );
        }
    }
View Full Code Here

        //Add to repository
        String[] add_cmd = new String[]{HgCommandConstants.ADD_CMD};
        ScmFileSet filesToAdd = new ScmFileSet( new File( "" ), files );
        add_cmd = HgUtils.expandCommandLine( add_cmd, filesToAdd );
        ScmResult result = HgUtils.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[]{HgCommandConstants.COMMIT_CMD, HgCommandConstants.MESSAGE_OPTION, COMMIT_MESSAGE};
        result = HgUtils.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

                {
                    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

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.