Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeSet


            return;
        }

        currentRevision = headerRegexp.getParen( 1 );

        currentChange = new ChangeSet();

        currentChange.setRevision( currentRevision );

        status = STATUS_GET_AUTHOR;
    }
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

        // 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

    {
        if ( !revisionRegexp.match( line ) )
        {
            return;
        }
        currentChange = new ChangeSet();
        currentRevision = revisionRegexp.getParen( 1 );
        currentChange.setAuthor( revisionRegexp.getParen( 2 ) );
        currentChange.setDate( revisionRegexp.getParen( 3 ), userDatePattern );

        status = GET_COMMENT_BEGIN;
View Full Code Here

            }

            if ( versions.isEmpty() || !files.isEmpty() )
            {
                ChangeSet changeSet = new ChangeSet( t.getWhen(), t.getComment(), t.getAuthor(), files );

                entries.add( changeSet );
            }
            else
            {
                if ( getLogger().isDebugEnabled() )
                {
                    getLogger().debug( "All versions removed for " + t );
                }
            }

        }

        // Anything left in the differencesMap represents a change from a higher stream
        // We don't have details on who or where these came from, but it is important to
        // detect these for CI tools like Continuum
        if ( !differencesMap.isEmpty() )
        {
            List<ChangeFile> upstreamFiles = new ArrayList<ChangeFile>();
            for ( FileDifference difference : differencesMap.values() )
            {
                if ( difference.getNewVersionSpec() != null )
                {
                    upstreamFiles.add( new ChangeFile( difference.getNewFile().getPath(),
                                                       difference.getNewVersionSpec() ) );
                }
                else
                {
                    // difference is a deletion
                    upstreamFiles.add( new ChangeFile( difference.getOldFile().getPath(), null ) );
                }
            }
            entries.add( new ChangeSet( endDate, "Upstream changes", "various", upstreamFiles ) );
        }

        return new ChangeLogSet( entries, startDate, endDate );
    }
View Full Code Here

    public void testCreateListChangesetCommand()
        throws Exception
    {
        // Dummy up two change sets.
        ChangeSet changeSet = new ChangeSet();
        changeSet.setRevision( "1010" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1012" );
        changeSets.add( changeSet );

        // Now test them
        Commandline cmd =
            new JazzChangeLogCommand().createListChangesetCommand( repo, getScmFileSet(), changeSets ).getCommandline();
View Full Code Here

    public void testListChangesetConsumer()
        throws Exception
    {
        // Dummy up our changeset list, as parsed from the previous "scm history" command
        ChangeSet changeSet = new ChangeSet();
        changeSet.setRevision( "1589" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1585" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1584" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1583" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1323" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1319" );
        changeSets.add( changeSet );

        listChangesetConsumer.consumeLine( "Change sets:" );
        listChangesetConsumer.consumeLine(
            "  (1589)  ---$ Deb \"[maven-release-plugin] prepare for next development iteration\"" );
View Full Code Here

    public void testListChangesetConsumerWithTimeOnly()
        throws Exception
    {
        // Dummy up our changeset list, as parsed from the previous "scm history" command
        ChangeSet changeSet = new ChangeSet();
        changeSet.setRevision( "1809" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1801" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1799" );
        changeSets.add( changeSet );
        changeSet = new ChangeSet();
        changeSet.setRevision( "1764" );
        changeSets.add( changeSet );

        listChangesetConsumer.consumeLine( "Change sets:" );
        listChangesetConsumer.consumeLine(
            "  (1809)  ---$ Deb \"[maven-release-plugin] prepare for next development iteration\"" );
View Full Code Here

                throw new ScmException( "You should checkout a working project first" );
            }
            List<SynergyTask> tasks = SynergyUtil.getCompletedTasks( getLogger(), projectSpec, startDate, endDate, ccmAddr );
            for ( SynergyTask t : tasks )
            {
                ChangeSet cs = new ChangeSet();
                cs.setAuthor( t.getUsername() );
                cs.setComment( "Task " + t.getNumber() + ": " + t.getComment() );
                cs.setDate( t.getModifiedTime() );
                cs.setFiles( SynergyUtil.getModifiedObjects( getLogger(), t.getNumber(), ccmAddr ) );
                csList.add( cs );
            }
        }
        finally
        {
View Full Code Here

                comment += "\n[MAVEN]:    " + currentChange.getComment();
                lastChange.setComment( comment );
            }

            //Init a new changeset
            currentChange = new ChangeSet();
            currentChange.setFiles( new ArrayList<ChangeFile>() );
            logEntries.add( currentChange );

            //Reset memeber vars
            currentComment = new StringBuilder();
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.