Examples of BranchScmResult


Examples of org.apache.maven.scm.command.branch.BranchScmResult

            getLog().info( "Final Branch Name: '" + finalBranch + "'" );

            ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message );
            scmBranchParameters.setRemoteBranching( remoteBranching );
           
            BranchScmResult result = provider.branch( repository, getFileSet(), finalBranch, scmBranchParameters );

            checkResult( result );
        }
        catch ( IOException e )
        {
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

            {
                files.add( new ScmFile( walk.getPathString(), ScmFileStatus.CHECKED_OUT ) );
            }
            walk.release();

            return new BranchScmResult( "JGit branch", files );

        }
        catch ( Exception e )
        {
            throw new ScmException( "JGit branch failed!", e );
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

    @Override
    public BranchScmResult executeBranchCommand( ScmProviderRepository repository, ScmFileSet fileSet,
                                                 String branchName, String message )
        throws ScmException
    {
        BranchScmResult result;
        IntegrityScmProviderRepository iRepo = (IntegrityScmProviderRepository) repository;
        Project siProject = iRepo.getProject();
        getLogger().info(
            "Attempting to branch project " + siProject.getProjectName() + " using branch name '" + branchName + "'" );
        try
        {
            Project.validateTag( branchName );
            Response res = siProject.createDevPath( branchName );
            int exitCode = res.getExitCode();
            boolean success = ( exitCode == 0 ? true : false );
            ScmResult scmResult = new ScmResult( res.getCommandString(), "", "Exit Code: " + exitCode, success );
            result = new BranchScmResult( new ArrayList<ScmFile>(), scmResult );
        }
        catch ( APIException aex )
        {
            ExceptionHandler eh = new ExceptionHandler( aex );
            getLogger().error( "MKS API Exception: " + eh.getMessage() );
            getLogger().info( eh.getCommand() + " exited with return code " + eh.getExitCode() );
            result = new BranchScmResult( eh.getCommand(), eh.getMessage(), "Exit Code: " + eh.getExitCode(), false );
        }
        catch ( Exception e )
        {
            getLogger().error( "Failed to checkpoint project! " + e.getMessage() );
            result = new BranchScmResult( "si createdevpath", e.getMessage(), "", false );
        }

        return result;
    }
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

        for ( ScmFile f : files )
        {
            fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
        }

        return new BranchScmResult( fileList, result );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

        int exitCode;

        exitCode = GitCommandLineUtils.execute( cl, stdout, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new BranchScmResult( cl.toString(), "The git-branch command failed.", stderr.getOutput(), false );
        }

        if ( repo.isPushChanges() )
        {
            // and now push the branch to the upstream repository
            Commandline clPush = createPushCommandLine( repository, fileSet, branch );

            exitCode = GitCommandLineUtils.execute( clPush, stdout, stderr, getLogger() );
            if ( exitCode != 0 )
            {
                return new BranchScmResult( clPush.toString(), "The git-push command failed.", stderr.getOutput(),
                                            false );
            }
        }

        // as last action we search for the branched files
        GitListConsumer listConsumer = new GitListConsumer( getLogger(), fileSet.getBasedir(), ScmFileStatus.TAGGED );

        Commandline clList = GitListCommand.createCommandLine( repository, fileSet.getBasedir() );

        exitCode = GitCommandLineUtils.execute( clList, listConsumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            return new BranchScmResult( clList.toString(), "The git-ls-files command failed.", stderr.getOutput(),
                                        false );
        }

        return new BranchScmResult( cl.toString(), listConsumer.getListedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

        {
            FileUtils.fileWrite( messageFile.getAbsolutePath(), scmBranchParameters.getMessage() );
        }
        catch ( IOException ex )
        {
            return new BranchScmResult( null, "Error while making a temporary file for the commit message: "
                + ex.getMessage(), null, false );
        }

        Commandline cl = createCommandLine( repository, fileSet.getBasedir(), branch, messageFile,
                                            scmBranchParameters );

        CommandLineUtils.StringStreamConsumer stdout = new CommandLineUtils.StringStreamConsumer();

        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();

        if ( getLogger().isInfoEnabled() )
        {
            getLogger().info( "Executing: " + SvnCommandLineUtils.cryptPassword( cl ) );
            getLogger().info( "Working directory: " + cl.getWorkingDirectory().getAbsolutePath() );
        }

        int exitCode;

        try
        {
            exitCode = SvnCommandLineUtils.execute( cl, stdout, stderr, getLogger() );
        }
        catch ( CommandLineException ex )
        {
            throw new ScmException( "Error while executing command.", ex );
        }
        finally
        {
            try
            {
                FileUtils.forceDelete( messageFile );
            }
            catch ( IOException ex )
            {
                // ignore
            }
        }

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

        List<ScmFile> fileList = new ArrayList<ScmFile>();

        List<File> files = null;

        try
        {
            @SuppressWarnings( "unchecked" )
            List<File> listFiles = FileUtils.getFiles( fileSet.getBasedir(), "**", "**/.svn/**", false );
            files = listFiles;
        }
        catch ( IOException e )
        {
            throw new ScmException( "Error while executing command.", e );
        }

        for ( File f : files )
        {
            fileList.add( new ScmFile( f.getPath(), ScmFileStatus.TAGGED ) );
        }

        return new BranchScmResult( cl.toString(), fileList );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

        ErrorStreamConsumer err = new ErrorStreamConsumer();
        int status = command.execute( out, err );
        getLogger().info( "status of branch command is= " + status + "; err= " + err.getOutput() );
        if ( status != 0 || err.hasBeenFed() )
        {
            return new BranchScmResult( command.getCommandString(), "Error code for TFS branch command - " + status,
                                        err.getOutput(), false );
        }
        return new BranchScmResult( command.getCommandString(), new ArrayList<ScmFile>( 0 ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

     */
    public ScmProviderStub()
    {
        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 ) );
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

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

        BranchScmResult result;
        try
        {
            ScmFileSet fileSet = new ScmFileSet( new File( releaseDescriptor.getWorkingDirectory() ) );
            String branchName = releaseDescriptor.getScmReleaseLabel();

            ScmBranchParameters scmBranchParameters = new ScmBranchParameters();
            scmBranchParameters.setMessage( releaseDescriptor.getScmCommentPrefix() + " copy for branch " + branchName );
            scmBranchParameters.setRemoteBranching( releaseDescriptor.isRemoteTagging() );
            scmBranchParameters.setScmRevision( releaseDescriptor.getScmReleasedPomRevision() );

            result = provider.branch( repository, fileSet, branchName, scmBranchParameters );
        }
        catch ( ScmException e )
        {
            throw new ReleaseExecutionException( "An error is occurred in the branch process: " + e.getMessage(), e );
        }

        if ( !result.isSuccess() )
        {
            throw new ReleaseScmCommandException( "Unable to branch SCM", result );
        }

        relResult.setResultCode( ReleaseResult.SUCCESS );
View Full Code Here

Examples of org.apache.maven.scm.command.branch.BranchScmResult

            getLog().info( "Final Branch Name: '" + finalBranch + "'" );

            ScmBranchParameters scmBranchParameters = new ScmBranchParameters( message );
            scmBranchParameters.setRemoteBranching( remoteBranching );
           
            BranchScmResult result = provider.branch( repository, getFileSet(), finalBranch, scmBranchParameters );

            checkResult( result );
        }
        catch ( IOException e )
        {
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.