Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeSet


        if ( changeSetRegExp.match( line ) )
        {
            // 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 = changeSetRegExp.getParen( 1 );
            String changeFlags = changeSetRegExp.getParen( 2 );     // Not used.
            String author = changeSetRegExp.getParen( 3 );
            String comment = changeSetRegExp.getParen( 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- (1171) \GPDB\GPDBResources\pom.xml
        //      ---c- (1167) \GPDB\GPDBWeb\pom.xml
        //      ---c- (1165) \GPDB\pom.xml
        if ( changesRegExp.match( line ) )
        {
            ChangeSet currentChangeSet = entries.get( currentChangeSetIndex );

            String changeFlags = changesRegExp.getParen( 1 );     // Not used.
            String fileAlias = changesRegExp.getParen( 2 );
            String file = changesRegExp.getParen( 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

                {
                    getLogger().error( "Date parse error", e );
                    throw new RuntimeException( e );
                }

                ChangeSet change = new ChangeSet( date, comment, username, files );
                logs.add( change );
            }
            buffer = "";
        }
    }
View Full Code Here

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

        ChangeLogSet changelogSets = changedLogs.get( 0 );

        assertEquals( "Test number of revisions on changelog 1", 2, changelogSets.getChangeSets().size() );

        ChangeSet changeSet = changelogSets.getChangeSets().get( 0 );

        assertEquals( "Test changelog 1 set 1 date/time", "1977-08-06 05:30:00",
                      new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( changeSet.getDate() ) );

        assertEquals( "Test changelog 1 set 1 author", "Edwin Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 1 set 1 msg", "First commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 1 set 1 files", 1, changeSet.getFiles().size() );

        ChangeFile changeFile = changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 1 set 1 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 1 file 1 revision", "1", changeFile.getRevision() );

        changeSet = changelogSets.getChangeSets().get( 1 );

        assertEquals( "Test changelog 1 set 2 date/time", "2005-02-24 21:30:00",
                      new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( changeSet.getDate() ) );

        assertEquals( "Test changelog 1 set 2 author", "Edwin Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 1 set 2 msg", "Second commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 1 set 2 files", 2, changeSet.getFiles().size() );

        changeFile = changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 1 set 2 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 2 file 1 revision", "2", changeFile.getRevision() );

        changeFile = changeSet.getFiles().get( 1 );

        assertEquals( "Test changelog 1 set 2 file 2 filename", "/path/to/file2.extension", changeFile.getName() );

        assertEquals( "Test changelog 1 set 2 file 2 revision", "2", changeFile.getRevision() );

        changelogSets = changedLogs.get( 1 );

        assertEquals( "Test number of revisions on changelog 2", 2, changelogSets.getChangeSets().size() );

        changeSet = changelogSets.getChangeSets().get( 0 );

        assertEquals( "Test changelog 2 set 1 date/time", "2005-02-25 22:45:00",
                      new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( changeSet.getDate() ) );

        assertEquals( "Test changelog 2 set 1 author", "Keogh Edrich Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 2 set 1 msg", "Third commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 2 set 1 files", 1, changeSet.getFiles().size() );

        changeFile = changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 2 set 1 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 1 file 1 revision", "3", changeFile.getRevision() );

        changeSet = changelogSets.getChangeSets().get( 1 );

        assertEquals( "Test changelog 2 set 2 date/time", "2100-02-25 05:30:00",
                      new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss" ).format( changeSet.getDate() ) );

        assertEquals( "Test changelog 2 set 2 author", "Keogh Edrich Punzalan", changeSet.getAuthor() );

        assertEquals( "Test changelog 2 set 2 msg", "Last commit msg", changeSet.getComment() );

        assertEquals( "Test changelog 2 set 2 files", 2, changeSet.getFiles().size() );

        changeFile = changeSet.getFiles().get( 0 );

        assertEquals( "Test changelog 2 set 2 file 1 filename", "/path/to/file.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 2 file 1 revision", "4", changeFile.getRevision() );

        changeFile = changeSet.getFiles().get( 1 );

        assertEquals( "Test changelog 2 set 2 file 2 filename", "/path/to/file2.extension", changeFile.getName() );

        assertEquals( "Test changelog 2 set 2 file 2 revision", "4", changeFile.getRevision() );
    }
View Full Code Here

    private void filter( List<ChangeSet> sets, List<Pattern> includes, List<Pattern> excludes )
    {
        Iterator<ChangeSet> it = sets.iterator();
        while ( it.hasNext() )
        {
            ChangeSet changeSet = it.next();
            List<ChangeFile> files = changeSet.getFiles();
            Iterator<ChangeFile> iterator = files.iterator();
            while ( iterator.hasNext() )
            {
                ChangeFile changeFile = iterator.next();
                String name = changeFile.getName();
View Full Code Here

        {
            bufFile = new ChangeFile( "" );
        }
        else if ( "changelog-entry".equals( qName ) )
        {
            bufEntry = new ChangeSet();
        }
        else if ( "date".equals( qName ) )
        {
            currentPattern = attributes.getValue( "pattern" );
            if ( currentPattern == null )
View Full Code Here

        // must use *Linked* HashMap to have predictable toString
        final Map<ScmFileStatus, AtomicInteger> summary = new LinkedHashMap<ScmFileStatus, AtomicInteger>();

        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() );

            for ( ChangeFile file : entry.getFiles() )
            {
                final ScmFileStatus action = file.getAction();
                if ( !summary.containsKey( action ) )
                {
                    summary.put( action, new AtomicInteger() );
                }
                summary.get( action ).incrementAndGet();
            }
        }
        Assert.assertEquals( "Action summary differs from expectations", "{modified=21, added=88, deleted=1}",
                             summary.toString() );

        assertEquals( 8, modifications.size() );

        ChangeSet entry = modifications.get( 4 );

        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-27 13:05:36 +0000", sdf.format( entry.getDate() ) );

        assertEquals( "52733aa427041cafd760833cb068ffe897fd35db", entry.getRevision() );

        assertEquals( "fixed a GitCommandLineUtil and provice first version of the checkin command.",
                      entry.getComment() );

        assertNotNull( entry.getFiles() );

        assertEquals( 10, entry.getFiles().size() );

        ChangeFile cf = entry.getFiles().get( 0 );
        assertEquals(
            "maven-scm-provider-gitexe/src/main/java/org/apache/maven/scm/provider/git/gitexe/command/GitCommandLineUtils.java",
            cf.getName() );
        assertTrue( cf.getRevision() != null && cf.getRevision().length() > 0 );
    }
View Full Code Here

        // new changeset
        if ( line.startsWith( REVNO_TAG ) )
        {
            //Init a new changeset
            currentChange = new ChangeSet();
            currentChange.setFiles( new ArrayList<ChangeFile>( 0 ) );
            logEntries.add( currentChange );

            // parse revision
            tmpLine = line.substring( REVNO_TAG.length() ).trim();
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.