Package org.apache.maven.scm.command.status

Examples of org.apache.maven.scm.command.status.StatusScmResult


        catch ( NoSuchScmProviderException e )
        {
            throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
        }

        StatusScmResult result;
        try
        {
            result =
                provider.status( repository, new ScmFileSet( new File( releaseDescriptor.getWorkingDirectory() ) ) );
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error occurred during the status check process: " + e.getMessage(),
                                                 e );
        }

        if ( !result.isSuccess() )
        {
            throw new ReleaseScmCommandException( "Unable to check for local modifications", result );
        }

        List<ScmFile> changedFiles = result.getChangedFiles();

        // TODO: would be nice for SCM status command to do this for me.
        for ( Iterator<ScmFile> i = changedFiles.iterator(); i.hasNext(); )
        {
            ScmFile f = i.next();
View Full Code Here


            getLog().info( "check-local-modification execution has been skipped" );
            return;
        }
        super.execute();

        StatusScmResult result = null;

        try
        {
            ScmRepository repository = getScmRepository();
            result = getScmManager().status( repository, new ScmFileSet( baseDirectory ) );
        }
        catch ( ScmException e )
        {
            throw new MojoExecutionException( e.getMessage(), e );
        }

        if ( !result.isSuccess() )
        {
            throw new MojoExecutionException( "Unable to check for local modifications :" + result.getProviderMessage() );
        }

        if ( !result.getChangedFiles().isEmpty() )
        {
            getLog().error( errorMessage );
            throw new MojoExecutionException( errorMessage );
        }
View Full Code Here

        try
        {
            ScmRepository repository = getScmRepository();

            StatusScmResult result = getScmManager().status( repository, getFileSet() );

            checkResult( result );

            File baseDir = getFileSet().getBasedir();

            // Determine the maximum length of the status column
            int maxLen = 0;

            for ( ScmFile file : result.getChangedFiles() )
            {
                maxLen = Math.max( maxLen, file.getStatus().toString().length() );
            }

            for ( ScmFile file : result.getChangedFiles() )
            {
                // right align all of the statuses
                getLog().info(
                               StringUtils.leftPad( file.getStatus().toString(), maxLen ) + " status for "
                                   + getRelativePath( baseDir, file.getPath() ) );
View Full Code Here

        Commandline command = readOpened( prepo, files, consumer );

        if ( consumer.isSuccess() )
        {
            List<ScmFile> scmfiles = createResults( actualLocation, consumer );
            return new StatusScmResult( command.toString(), scmfiles );
        }

        return new StatusScmResult( command.toString(), "Unable to get status", consumer
                .getOutput(), consumer.isSuccess() );
    }
View Full Code Here

        // src/main/java/org/Foo.java is added
        // /pom.xml is modified
        // check that readme and project.xml are not updated/created
        // ----------------------------------------------------------------------

        StatusScmResult result = scmManager.getProviderByUrl( getScmUrl() )
            .status( repository, new ScmFileSet( getUpdatingCopy() ) );

        if ( this.commitUpdateCopy() )
        {
          //this is needed for perforce so that teardown can remove its client workspace, no harm for cvs/svn/git
            commit( getUpdatingCopy(), repository );
        }

        assertNotNull( "The command returned a null result.", result );

        assertResultIsSuccess( result );

        List<ScmFile> changedFiles = result.getChangedFiles();

        assertEquals( "Expected 2 files in the updated files list " + changedFiles, 2, changedFiles.size() );

        // ----------------------------------------------------------------------
        // Assert the files in the updated files list
View Full Code Here

        {
            git = Git.open( fileSet.getBasedir() );
            Status status = git.status().call();
            List<ScmFile> changedFiles = getFileStati( status );

            return new StatusScmResult( "JGit status", changedFiles );
        }
        catch ( Exception e )
        {
            throw new ScmException( "JGit status failure!", e );
        }
View Full Code Here

            {
                getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" );
            }
        }

        return new StatusScmResult( cl.toString(), consumer.getChangedFiles() );
    }
View Full Code Here

        catch ( NoSuchScmProviderException e )
        {
            throw new ReleaseExecutionException( "Unable to configure SCM repository: " + e.getMessage(), e );
        }

        StatusScmResult result;
        try
        {
            result =
                provider.status( repository, new ScmFileSet( new File( releaseDescriptor.getWorkingDirectory() ) ) );
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error occurred during the status check process: " + e.getMessage(),
                                                 e );
        }

        if ( !result.isSuccess() )
        {
            throw new ReleaseScmCommandException( "Unable to check for local modifications", result );
        }

        List<ScmFile> changedFiles = result.getChangedFiles();

        // TODO: would be nice for SCM status command to do this for me.
        for ( Iterator<ScmFile> i = changedFiles.iterator(); i.hasNext(); )
        {
            ScmFile f = i.next();
View Full Code Here

        }

        public StatusScmResult status( ScmRepository repository, ScmFileSet fileSet )
            throws ScmException
        {
            return new StatusScmResult( changedFiles, new ScmResult( null, null, null, true ) );
        }
View Full Code Here

        List<File> files = fileSet.getFileList();
        if ( files.isEmpty() )
        { //Either commit all changes
            HgStatusCommand statusCmd = new HgStatusCommand();
            statusCmd.setLogger( getLogger() );
            StatusScmResult status = statusCmd.executeStatusCommand( repo, fileSet );
            List<ScmFile> statusFiles = status.getChangedFiles();
            for ( ScmFile file : statusFiles )
            {
                if ( file.getStatus() == ScmFileStatus.ADDED || file.getStatus() == ScmFileStatus.DELETED
                    || file.getStatus() == ScmFileStatus.MODIFIED )
                {
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.command.status.StatusScmResult

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.