Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeSet


                    // Lets create our ChangeFile based on the information we've gathered so far
                    ChangeFile changeFile = new ChangeFile( memberName, revision );

                    // Check to see if we already have a ChangeSet grouping for this revision
                    ChangeSet changeSet = changeSetHash.get( cpid );
                    if ( null != changeSet )
                    {
                        // Set the date of the ChangeSet to the oldest entry
                        if ( changeSet.getDate().after( date ) )
                        {
                            changeSet.setDate( date );
                        }
                        // Add the new ChangeFile
                        changeSet.addFile( changeFile );
                        // Update the changeSetHash
                        changeSetHash.put( cpid, changeSet );
                    }
                    else // Create a new ChangeSet grouping and add the ChangeFile
                    {
                        List<ChangeFile> changeFileList = new ArrayList<ChangeFile>();
                        changeFileList.add( changeFile );
                        changeSet = new ChangeSet( date, comment, author, changeFileList );
                        // Update the changeSetHash with an initial entry for the cpid
                        changeSetHash.put( cpid, changeSet );
                    }
                }
            }
View Full Code Here


            {
                return set1.getDate().compareTo( set2.getDate() );
            }
        } );
        List<ChangeSet> fixedModifications = new ArrayList<ChangeSet>();
        ChangeSet currentEntry = null;
        for ( Iterator<ChangeSet> entryIterator = entries.iterator(); entryIterator.hasNext(); )
        {
            ChangeSet entry = (ChangeSet) entryIterator.next();
            if ( currentEntry == null )
            {
                currentEntry = entry;
            }
            else if ( areEqual( currentEntry, entry ) )
            {
                currentEntry.addFile( (ChangeFile) entry.getFiles().get( 0 ) );
            }
            else
            {
                fixedModifications.add( currentEntry );
                currentEntry = entry;
View Full Code Here

     */
    private void processGetFile( String line )
    {
        if ( line.startsWith( START_FILE ) )
        {
            setCurrentChange( new ChangeSet() );
            setCurrentFile( new ChangeFile( line.substring( START_FILE.length(), line.length() ) ) );
            setStatus( GET_REVISION );
        }
    }
View Full Code Here

        if ( line.startsWith( START_REVISION ) )
        {
            // add entry, and set state to get revision
            addEntry( getCurrentChange(), getCurrentFile() );
            // new change log entry
            setCurrentChange( new ChangeSet() );
            // same file name, but different rev
            setCurrentFile( new ChangeFile( getCurrentFile().getName() ) );
            setStatus( GET_REVISION );
        }
        else if ( line.startsWith( END_FILE ) )
View Full Code Here

        ChangeLogScmResult result = command.changelog( repo, testFileSet, commandParameters );

        assertThat( result.isSuccess(), is( true ) );
        List<ChangeSet> changeSets = result.getChangeLog().getChangeSets();
        assertThat( changeSets.size(), is( 3 ) );
        ChangeSet cs = (ChangeSet) changeSets.get( 0 );
        assertThat( cs.getAuthor(), is( "aUser" ) );
        assertThat( cs.getComment(), is( "a Comment" ) );
        assertThat( cs.getDate(), is( keepWhen ) );
        assertThat( cs.getFiles().size(), is( 1 ) );
        ChangeFile cf = (ChangeFile) cs.getFiles().get( 0 );

        assertThat( cf.getName(), is( "/./kept/file" ) );
        assertThat( cf.getRevision(), is( "10/5 (5/5)" ) );

        cs = (ChangeSet) changeSets.get( 2 );
        assertThat( cs.getAuthor(), is( "various" ) );
        // created/removed/moved but not the file that was in the promoted
        // set...
        assertThat( cs.getComment(), is( "Upstream changes" ) );
        assertThat( cs.getFiles().size(), is( 3 ) );
        assertThat( cs.containsFilename( "created/file" ), is( true ) );
    }
View Full Code Here

     
      // Date > ChangeSet
        Map<Date,ChangeSet> groupedEntries = new LinkedHashMap<Date,ChangeSet>();
        for ( int i = 0; i < entries.size(); i++ )
        {
            ChangeSet cs = (ChangeSet) entries.get( i );
            ChangeSet hit = (ChangeSet) groupedEntries.get( cs.getDate() );
            if ( hit != null )
            {
                if ( cs.getFiles().size() != 1 )
                {
                    throw new ScmException( "Merge of entries failed. Bad entry size: " + cs.getFiles().size() );
                }
                hit.addFile( (ChangeFile) cs.getFiles().get( 0 ) );
            }
            else
            {
                groupedEntries.put( cs.getDate(), cs );
            }
View Full Code Here

        if ( !revisionRegexp.match( line ) )
        {
            return;
        }

        currentChange = new ChangeSet();
        currentChange.setDate( parseDate( revisionRegexp.getParen( 3 ), userDatePattern, PERFORCE_TIMESTAMP_PATTERN ) );
        currentChange.setAuthor( revisionRegexp.getParen( 4 ) );

        status = GET_COMMENT_BEGIN;
    }
View Full Code Here

       
        List<ChangeFile>
        changeFiles =
            Arrays.asList( new ChangeFile[] { new ChangeFile( line, Integer.valueOf( revision ).toString() ) } );

        ChangeSet changeSet = new ChangeSet( null, null, null, changeFiles );
        changeSets.add( changeSet );
    }
View Full Code Here

            .changeLog( getScmRepository(), fileSet, timeBeforeSecond, currentTime, 0, new ScmBranch( "" ) );

        //Thorough assert of the last result
        assertTrue( result.getProviderMessage(), result.isSuccess() );
        assertEquals( 1, result.getChangeLog().getChangeSets().size() );
        ChangeSet changeset = result.getChangeLog().getChangeSets().get( 0 );
        assertTrue( changeset.getDate().after( timeBeforeSecond ) );
        assertEquals( COMMIT_MSG, changeset.getComment() );
    }
View Full Code Here

                List<ChangeFile> changeFiles = new ArrayList<ChangeFile>( files.size() );
                for (ScmFile scmFile : files)
                {
                    changeFiles.add(new ChangeFile( scmFile.getPath() ));
                }
                ChangeSet dummyChangeSet = new ChangeSet( new Date(), comment, author, changeFiles );
                // different streams invalidates the change log, insert a dummy change instead.
                List<ChangeSet> changeSets = Collections.singletonList( dummyChangeSet );
                result.setChanges( changeSets );
            }
View Full Code Here

TOP

Related Classes of org.apache.maven.scm.ChangeSet

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.