Examples of AddScmResult


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

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

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

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

            localRepo.addFile( path );
            fileList.add( new ScmFile( path, ScmFileStatus.ADDED ) );
        }

        // TODO: Also, ensure it is tested from the update test
        return new AddScmResult( null, fileList );
    }
View Full Code Here

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

            if ( repo.isFileAdded( path ) )
            {
                return new MkdirScmResult( null, "Directory already exists!", "Directory already exists.", false );
            }

            AddScmResult result = (AddScmResult) addCmd.execute( repository, fileSet, parameters );
            createdDirs.addAll( result.getAddedFiles() );
        }

        return new MkdirScmResult( null, createdDirs );
    }
View Full Code Here

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

            int exitCode = StarteamCommandLineUtils.executeCommandline( cl, consumer, stderr, getLogger() );

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

        return new AddScmResult( null, consumer.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

     * 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

        File f = new File( workingDirectory.getAbsolutePath() + File.separator + "pom.xml" );
        FileUtils.fileWrite( f.getAbsolutePath(), "toto" );

        ScmFileSet scmFileSet = new ScmFileSet( workingDirectory, new File( "pom.xml" ) );
        AddScmResult addResult = getScmManager().add( scmRepository, scmFileSet );
        assertResultIsSuccess( addResult );

        CheckInScmResult checkInScmResult = getScmManager().checkIn( scmRepository, scmFileSet, "commit" );
        assertResultIsSuccess( checkInScmResult );
        assertEquals( 1, checkInScmResult.getCheckedInFiles().size() );
View Full Code Here

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

        barDir.mkdir();
        File wineFile = new File(barDir.getAbsolutePath() + File.separator + "wine.xml");
        FileUtils.fileWrite( wineFile.getAbsolutePath(), "Lacoste castle" );

        // Adding and commiting file
        AddScmResult addResult = getScmManager().add( scmRepository, new ScmFileSet( checkedOutRepo, new File( "foo/bar/wine.xml" ) ) );
        assertResultIsSuccess( addResult );
        CheckInScmResult checkInScmResult = getScmManager().checkIn(scmRepository, new ScmFileSet(checkedOutRepo), "Created wine file");
        assertResultIsSuccess( checkInScmResult );

        // Cloning foo/bar/wine.xml to foo/newbar/wine.xml
View Full Code Here

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

        if ( fileSet.getFileList().isEmpty() )
        {
            throw new ScmException( "You must provide at least one file/directory to add" );
        }

        AddScmResult result = executeAddFileSet( fileSet );

        if ( result != null )
        {
            return result;
        }

        // git-add doesn't show single files, but only summary :/
        // so we must run git-status and consume the output
        // borrow a few things from the git-status command
        Commandline clStatus = GitStatusCommand.createCommandLine( repository, fileSet );

        GitStatusConsumer statusConsumer = new GitStatusConsumer( getLogger(), fileSet.getBasedir() );
        CommandLineUtils.StringStreamConsumer stderr = new CommandLineUtils.StringStreamConsumer();
        int exitCode = GitCommandLineUtils.execute( clStatus, statusConsumer, stderr, getLogger() );
        if ( exitCode != 0 )
        {
            // git-status returns non-zero if nothing to do
            if ( getLogger().isInfoEnabled() )
            {
                getLogger().info( "nothing added to commit but untracked files present (use \"git add\" to track)" );
            }
        }

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

        // rewrite all detected files to now have status 'checked_in'
        for ( ScmFile scmfile : statusConsumer.getChangedFiles() )
        {
            // if a specific fileSet is given, we have to check if the file is really tracked
            for ( File f : fileSet.getFileList() )
            {
                if ( FilenameUtils.separatorsToUnix( f.getPath() ).equals( scmfile.getPath() ) )
                {
                    changedFiles.add( scmfile );
                }
            }
        }

        Commandline cl = createCommandLine( fileSet.getBasedir(), fileSet.getFileList() );
        return new AddScmResult( cl.toString(), changedFiles );
    }
View Full Code Here

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

        // command line can be too long for windows so add files individually (see SCM-697)
        if ( Os.isFamily( Os.FAMILY_WINDOWS ) )
        {
            for ( File file : files )
            {
                AddScmResult result = executeAddFiles( workingDirectory, Collections.singletonList( file ) );

                if ( result != null )
                {
                    return result;
                }
            }
        }
        else
        {
            AddScmResult result = executeAddFiles( workingDirectory, files );

            if ( result != null )
            {
                return result;
            }
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.