Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeSet


        Matcher matcher = REVISION_PATTERN.matcher( line );
        if ( !matcher.find() )
        {
            return;
        }
        currentChange = new ChangeSet();
        currentRevision = matcher.group( 1 );
        currentChange.setAuthor( matcher.group( 2 ) );
        currentChange.setDate( matcher.group( 3 ), userDatePattern );

        status = GET_COMMENT_BEGIN;
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 ( !matcher.find() )
        {
            return;
        }

        currentChange = new ChangeSet();
        currentChange.setRevision( matcher.group( 1 ));
        currentChange.setDate( parseDate( matcher.group( 3 ), userDatePattern, PERFORCE_TIMESTAMP_PATTERN ) );
        currentChange.setAuthor( matcher.group( 4 ) );

        status = GET_COMMENT_BEGIN;
View Full Code Here

            return;
        }

        currentRevision = matcher.group( 1 );

        currentChange = new ChangeSet();

        currentChange.setRevision( currentRevision );

        status = STATUS_GET_AUTHOR;
    }
View Full Code Here

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

        //Thorough assert of the last result
        assertTrue( thirdResult.getProviderMessage(), thirdResult.isSuccess() );
        assertEquals( 1, thirdResult.getChangeLog().getChangeSets().size() );
        ChangeSet changeset = thirdResult.getChangeLog().getChangeSets().get( 0 );
        assertTrue( changeset.getDate().after( timeBeforeSecond ) );


        assertEquals( COMMIT_MSG, changeset.getComment() );
    }
View Full Code Here

        super.consumeLine( line );
        Matcher matcher = CHANGESET_PATTERN.matcher( line );
        if ( matcher.find() )
        {
            String changesetAlias = matcher.group( 1 );
            ChangeSet changeSet = new ChangeSet();
            changeSet.setRevision( changesetAlias );

            entries.add( changeSet );
        }
    }
View Full Code Here

        if ( matcher.find() )
        {
            // This is the only place this gets incremented.
            // It starts at -1, and on first execution is incremented to 0 - which is correct.
            currentChangeSetIndex++;
            ChangeSet currentChangeSet = entries.get( currentChangeSetIndex );

            // Init the file of files, so it is not null, but it can be empty!
            List<ChangeFile> files = new ArrayList<ChangeFile>();
            currentChangeSet.setFiles( files );

            String changesetAlias = matcher.group( 1 );
            String changeFlags = matcher.group( 2 );     // Not used.
            String author = matcher.group( 3 );
            String comment = matcher.group( 4 );

            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug( "  Parsing ChangeSet Line : " + line );
                getLogger().debug( "    changesetAlias : " + changesetAlias );
                getLogger().debug( "    changeFlags    : " + changeFlags );
                getLogger().debug( "    author         : " + author );
                getLogger().debug( "    comment        : " + comment );
            }

            // Sanity check.
            if ( currentChangeSet.getRevision() != null && !currentChangeSet.getRevision().equals( changesetAlias ) )
            {
                getLogger().warn( "Warning! The indexes appear to be out of sequence! " +
                                      "For currentChangeSetIndex = " + currentChangeSetIndex + ", we got '" +
                                      changesetAlias + "' and not '" + currentChangeSet.getRevision()
                                      + "' as expected." );
            }

            comment = stripDelimiters( comment );
            currentChangeSet.setAuthor( author );
            currentChangeSet.setComment( comment );
        }
    }
View Full Code Here

            {
                getLogger().debug( "    date           : " + date );
                getLogger().debug( "    changesetDate  : " + changesetDate );
            }

            ChangeSet currentChangeSet = entries.get( currentChangeSetIndex );
            currentChangeSet.setDate( changesetDate );
        }
    }
View Full Code Here

        //      ---c- (1167) \GPDB\GPDBWeb\pom.xml
        //      ---c- (1165) \GPDB\pom.xml
        Matcher matcher = CHANGES_PATTERN.matcher( line );
        if ( matcher.find() )
        {
            ChangeSet currentChangeSet = entries.get( currentChangeSetIndex );

            String changeFlags = matcher.group( 1 );     // Not used.
            String fileAlias = matcher.group( 2 );
            String file = matcher.group( 3 );

            if ( getLogger().isDebugEnabled() )
            {
                getLogger().debug( "  Parsing Changes Line : " + line );
                getLogger().debug(
                    "    changeFlags    : " + changeFlags + " Translated to : " + parseFileChangeState( changeFlags ) );
                getLogger().debug( "    filetAlias     : " + fileAlias );
                getLogger().debug( "    file           : " + file );
            }

            ChangeFile changeFile = new ChangeFile( file );
            ScmFileStatus status = parseFileChangeState( changeFlags );
            changeFile.setAction( status );
            currentChangeSet.getFiles().add( changeFile );
        }
    }
View Full Code Here

        assertEquals( 6, modifications.size() );

        for ( Iterator<ChangeSet> i = modifications.iterator(); i.hasNext(); )
        {
            ChangeSet entry = i.next();

            assertEquals( "Mark Struberg <struberg@yahoo.de>", entry.getAuthor() );

            assertNotNull( entry.getDate() );

            assertTrue( entry.getComment() != null && entry.getComment().length() > 0 );

            assertNotNull( entry.getRevision() );

            assertNotNull( entry.getFiles() );
            assertFalse( entry.getFiles().isEmpty() );
        }

        ChangeSet entry = modifications.get( 3 );

        assertEquals( "Mark Struberg <struberg@yahoo.de>", entry.getAuthor() );

        assertNotNull( entry.getDate() );
        SimpleDateFormat sdf = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss Z" );
        sdf.setTimeZone( TimeZone.getTimeZone( "GMT" ) );

        assertEquals( "2007-11-24 00:10:42 +0000", sdf.format( entry.getDate() ) );

        assertEquals( "895d423689da3b36d8e9106c0ecbf3d62433978c", entry.getRevision() );

        assertEquals( "/ added", entry.getComment() );

        assertNotNull( entry.getFiles() );
        ChangeFile cf = entry.getFiles().get( 0 );
        assertEquals( "readme.txt", cf.getName() );
        assertTrue( cf.getRevision() != null && cf.getRevision().length() > 0 );
    }
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.