Examples of AddScmResult


Examples of org.apache.maven.scm.command.add.AddScmResult

        File scmFile = new File( basedir, scmFilePath );

        if ( scmFilePath.length() != 0 )
        {
            AddScmResult result = scmProvider.add( scmRepository, new ScmFileSet( basedir, new File( scmFilePath ) ) );

            /*
             * TODO dirty fix to work around files with property svn:eol-style=native if a file has that property, first
             * time file is added it fails, second time it succeeds the solution is check if the scm provider is svn and
             * unset that property when the SCM API allows it
             */
            if ( !result.isSuccess() )
            {
                result = scmProvider.add( scmRepository, new ScmFileSet( basedir, new File( scmFilePath ) ) );
            }

            addedFiles = result.getAddedFiles().size();
        }

        String reservedScmFile = scmProvider.getScmSpecificFilename();

        if ( scmFile.isDirectory() )
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

     * Create a new ScmProviderStub with bogus (not null) attributes
     */
    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 ) );
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        throws ScmException
    {
        // Call the Add command to perform the checkin into the repository workspace.
        JazzAddCommand addCommand = new JazzAddCommand();
        addCommand.setLogger( getLogger() );
        AddScmResult addResult = addCommand.executeAddCommand( repo, fileSet );

        // Now, if it has a flow target, deliver it.
        JazzScmProviderRepository jazzRepo = (JazzScmProviderRepository) repo;
        if ( jazzRepo.isPushChangesAndHaveFlowTargets() )
        {
            // Push if we need too
            JazzScmCommand deliverCmd = createDeliverCommand( (JazzScmProviderRepository) repo, fileSet );
            StreamConsumer deliverConsumer =
                new DebugLoggerConsumer( getLogger() );      // No need for a dedicated consumer for this
            ErrorConsumer errConsumer = new ErrorConsumer( getLogger() );

            int status = deliverCmd.execute( deliverConsumer, errConsumer );
            if ( status != 0 || errConsumer.hasBeenFed() )
            {
                return new CheckInScmResult( deliverCmd.getCommandString(),
                                             "Error code for Jazz SCM deliver command - " + status,
                                             errConsumer.getOutput(), false );
            }
        }

        // Return what was added.
        return new CheckInScmResult( addResult.getCommandLine(), addResult.getAddedFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        JazzScmCommand command = createAddCommand( repo, fileSet );

        int status = command.execute( addConsumer, errConsumer );
        if ( status != 0 || errConsumer.hasBeenFed() )
        {
            return new AddScmResult( command.getCommandString(),
                                     "Error code for Jazz SCM add (checkin) command - " + status,
                                     errConsumer.getOutput(), false );
        }

        return new AddScmResult( command.getCommandString(), addConsumer.getFiles() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

            {
                getLogger().error( "CommandLineException " + e.getMessage(), e );
            }
        }

        return new AddScmResult( cl.toString(), consumer.getAdditions() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

     * Create a new ScmProviderStub with bogus (not null) attributes
     */
    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 ) );
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        ScmProvider provider = getScmManager().getProviderByUrl( getScmUrl() );

        CommandParameters commandParameters = new CommandParameters();
        commandParameters.setString( CommandParameter.FORCE_ADD, Boolean.TRUE.toString() );

        AddScmResult result = provider.add( repository, new ScmFileSet( workingDirectory, file ), commandParameters );

        assertTrue( "Check result was successful, output: " + result.getCommandOutput(), result.isSuccess() );

        List<ScmFile> addedFiles = result.getAddedFiles();

        if ( new File( workingDirectory, file.getPath() ).isFile() )
        {
            // Don't check directory add because some SCM tools ignore it
            assertEquals( "Expected 1 file in the added files list " + addedFiles, 1, addedFiles.size() );
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        createBarJava( barJava );

        changeReadmeTxt( readmeTxt );

        AddScmResult addResult = getScmManager().add( getScmRepository(),
                                                      new ScmFileSet( getWorkingCopy(), "src/main/java/Foo.java",
                                                                      null ) );

        assertResultIsSuccess( addResult );
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        createBarJava( barJava );

        changeReadmeTxt( readmeTxt );

        AddScmResult addResult = getScmManager().getProviderByUrl( getScmUrl() ).add( getScmRepository(),
                                                                                      new ScmFileSet( getWorkingCopy(),
                                                                                                      "src/main/java/Foo.java",
                                                                                                      null ) );

        assertResultIsSuccess( addResult );
View Full Code Here

Examples of org.apache.maven.scm.command.add.AddScmResult

        List<ScmFile> scmFiles = new ArrayList<ScmFile>( fileSet.getFileList().size() );
        for ( File f : fileSet.getFileList() )
        {
            scmFiles.add( new ScmFile( f.getPath(), ScmFileStatus.ADDED ) );
        }
        return new AddScmResult( "", scmFiles );
    }
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.