Examples of CheckOutScmResult


Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

                // Subversion is the only SCM that adds path structure to represent tags and branches.
                // The rest use scmVersion and scmVersionType.
                repoUrl += "/" + target.replace( '\\', '/' );
            }
            scmRepository = getScmRepository( repoUrl );
            CheckOutScmResult ret =
                scmProvider.checkOut( scmRepository, new ScmFileSet( new File( checkoutDirectory, "" ) ),
                                      makeScmVersion(), false );

            checkScmResult( ret );
        }
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

        setScmSpecificFilename( "" );
        setAddScmResult( new AddScmResult( "", Collections.<ScmFile>emptyList() ) );
        setBranchScmResult( new BranchScmResult( "", Collections.<ScmFile>emptyList() ) );
        setChangeLogScmResult( new ChangeLogScmResult( "", "", "", true ) );
        setCheckInScmResult( new CheckInScmResult( "", "", "", true ) );
        setCheckOutScmResult( new CheckOutScmResult( "", "", "", true ) );
        setDiffScmResult( new DiffScmResult( "", "", "", true ) );
        setEditScmResult( new EditScmResult( "", "", "", true ) );
        setExportScmResult( new ExportScmResult( "", "", "", true ) );
        setRemoveScmResult( new RemoveScmResult( "", "", "", true ) );
        setStatusScmResult( new StatusScmResult( "", "", "", true ) );
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

            String tag = config.getTag();
            getLogger().info(
                "Checking out project: '" + project.getName() + "', id: '" + project.getId() + "' " + "to '" +
                    workingDirectory + "'" + ( tag != null ? " with branch/tag " + tag + "." : "." ) );

            CheckOutScmResult checkoutResult = scm.checkout( config );
            if ( StringUtils.isNotEmpty( checkoutResult.getRelativePathProjectDirectory() ) )
            {
                context.put( KEY_PROJECT_RELATIVE_PATH, checkoutResult.getRelativePathProjectDirectory() );
            }

            if ( !checkoutResult.isSuccess() )
            {
                // TODO: is it more appropriate to return this in the converted result so that it can be presented to
                // the user?
                String msg = "Error while checking out the code for project: '" + project.getName() + "', id: '" +
                    project.getId() + "' to '" + workingDirectory.getAbsolutePath() + "'" +
                    ( tag != null ? " with branch/tag " + tag + "." : "." );
                getLogger().warn( msg );

                getLogger().warn( "Command output: " + checkoutResult.getCommandOutput() );

                getLogger().warn( "Provider message: " + checkoutResult.getProviderMessage() );
            }
            else
            {
                getLogger().info( "Checked out " + checkoutResult.getCheckedOutFiles().size() + " files." );
            }

            result = convertScmResult( checkoutResult );
        }
        catch ( ScmRepositoryException e )
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

        // TODO: probably need to base this from a working directory in the main configuration
        File workingDirectory = configuration.getWorkingDirectory();

        ScmRepository repository = getScmRepository( configuration );

        CheckOutScmResult result;

        // TODO: synchronizing *all* checkouts is unnecessary
        synchronized ( this )
        {
            if ( !workingDirectory.exists() )
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

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

        UpdateScmResult updateScmResult = null;
        CheckOutScmResult checkOutScmResult = null;
       
        File workingDirectory = new File( releaseDescriptor.getWorkingDirectory() );
       
        try
        {
            if ( !workingDirectory.exists() )
            {
                workingDirectory.mkdirs();
            }
           
            if( workingDirectory.listFiles().length > 1 )
            {
                updateScmResult = provider.update( repository, new ScmFileSet( workingDirectory ), (ScmVersion) null );
            }
            else
            {
                checkOutScmResult = provider.checkOut( repository, new ScmFileSet( workingDirectory ) );
            }
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error occurred while updating your local copy: " + e.getMessage(),
                                                 e );
        }

        if ( updateScmResult != null )
        {
            if( !updateScmResult.isSuccess() )
            {
                throw new ReleaseScmCommandException( "Unable to update current working copy", updateScmResult );
            }
           
            copyUpdated = updateScmResult.getUpdatedFiles().size() > 0;
        }
        else
        {
            if( !checkOutScmResult.isSuccess() )
            {
                throw new ReleaseScmCommandException( "Unable to checkout project", checkOutScmResult );
            }
           
            copyUpdated = checkOutScmResult.getCheckedOutFiles().size() > 0;
        }

        relResult.setResultCode( ReleaseResult.SUCCESS );

        return relResult;
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

            throw new ScmException( "Error while deleting working directory.", ex );
        }

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

        return new CheckOutScmResult( cl.toString(), consumer.getCheckedOutFiles(), projectDirectory );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

                }
            }

            if ( consumer.isSuccess() )
            {
                return new CheckOutScmResult( cl.toString(), consumer.getCheckedout() );
            }
            else
            {
                return new CheckOutScmResult( cl.toString(), "Unable to sync.  Are you logged in?",
                                              consumer.getOutput(), consumer.isSuccess() );
            }
        }
        finally
        {
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

        PerforceCheckOutCommand command = new PerforceCheckOutCommand();
        command.setLogger( getLogger() );
        CommandParameters params = new CommandParameters();
        params.setScmVersion( CommandParameter.SCM_VERSION, scmVersion );

        CheckOutScmResult cosr = (CheckOutScmResult) command.execute( repo, files, params );
        if ( !cosr.isSuccess() )
        {
            return new UpdateScmResult( cosr.getCommandLine(), cosr.getProviderMessage(), cosr.getCommandOutput(),
                                        false );
        }

        PerforceScmProviderRepository p4repo = (PerforceScmProviderRepository) repo;
        String clientspec = PerforceScmProvider.getClientspecName( getLogger(), p4repo, files.getBasedir() );
        Commandline cl = createCommandLine( p4repo, files.getBasedir(), clientspec );

        @SuppressWarnings( "unused" )
        String location = PerforceScmProvider.getRepoPath( getLogger(), p4repo, files.getBasedir() );
        PerforceHaveConsumer consumer =
            new PerforceHaveConsumer( getLogger() );

        try
        {
            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug( PerforceScmProvider.clean( "Executing " + cl.toString() ) );
            }

            CommandLineUtils.StringStreamConsumer err = new CommandLineUtils.StringStreamConsumer();
            int exitCode = CommandLineUtils.executeCommandLine( cl, consumer, err );

            if ( exitCode != 0 )
            {
                String cmdLine = CommandLineUtils.toString( cl.getCommandline() );

                StringBuilder msg = new StringBuilder( "Exit code: " + exitCode + " - " + err.getOutput() );
                msg.append( '\n' );
                msg.append( "Command line was:" + cmdLine );

                throw new CommandLineException( msg.toString() );
            }
        }
        catch ( CommandLineException e )
        {
            if ( getLogger().isErrorEnabled() )
            {
                getLogger().error( "CommandLineException " + e.getMessage(), e );
            }
        }

        return new UpdateScmResultWithRevision( cosr.getCommandLine(), cosr.getCheckedOutFiles(),
                                                String.valueOf( consumer.getHave() ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

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

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

Examples of org.apache.maven.scm.command.checkout.CheckOutScmResult

            throw new ScmException( "Error while executing command.", ex );
        }

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

        return new CheckOutScmResult( cl.toString(), Integer.toString( consumer.getRevision() ),
                                      consumer.getCheckedOutFiles() );
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.