Package org.apache.maven.scm

Examples of org.apache.maven.scm.ChangeFile


            tmpLine = line.substring( FILES_TOKEN.length() ).trim();
            String[] files = tmpLine.split( " " );
            for ( int i = 0; i < files.length; i++ )
            {
                String file = files[i];
                ChangeFile changeFile = new ChangeFile( file, currentRevision );
                currentChange.addFile( changeFile );
            }
        }
        else if ( line.length() > 0 )
        {
View Full Code Here


        addFile( new ScmFile( file, status ) );
       
        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

            currentComment.append( "\n" );
        }
        else if ( currentStatus != null )
        {
            tmpLine = tmpLine.trim();
            final ChangeFile changeFile;
            if ( currentStatus == ScmFileStatus.RENAMED )
            {
                final String[] parts = tmpLine.split( RENAME_SEPARATOR );
                if ( parts.length != 2 )
                {
                    changeFile = new ChangeFile( tmpLine, currentRevision );
                }
                else
                {
                    changeFile = new ChangeFile( parts[1], currentRevision );
                    changeFile.setOriginalName( parts[0] );
                }
            }
            else
            {
                changeFile = new ChangeFile( tmpLine, currentRevision );
            }
            changeFile.setAction( currentStatus );
            currentChange.addFile( changeFile );
        }
        else if ( line.startsWith( BRANCH_NICK_TOKEN ) )
        {
            //ignore
View Full Code Here

            tmpLine = line.substring( FILES_TOKEN.length() ).trim();
            String[] files = tmpLine.split( " " );
            for ( int i = 0; i < files.length; i++ )
            {
                String file = files[i];
                ChangeFile changeFile = new ChangeFile( file, currentRevision );
                currentChange.addFile( changeFile );
            }
        }
        else if ( line.length() > 0 )
        {
View Full Code Here

            else
            {
                action = ScmFileStatus.UNKNOWN;
            }
            System.out.println( actionStr + " : " + name );
            final ChangeFile changeFile = new ChangeFile( name, currentRevision );
            changeFile.setAction( action );
            changeFile.setOriginalName( originalName );
            changeFile.setOriginalRevision( originalRev );
            currentChange.addFile( changeFile );

            status = GET_FILE;
        }
        else if ( line.equals( FILE_END_TOKEN ) )
View Full Code Here

            else
            {
                action = ScmFileStatus.UNKNOWN;
            }

            final ChangeFile changeFile = new ChangeFile( name, currentRevision );
            changeFile.setAction( action );
            changeFile.setOriginalName( originalName );
            changeFile.setOriginalRevision( originalRevision );
            currentChange.addFile( changeFile );
        }
    }
View Full Code Here

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

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

        assertNotNull( entry.getFiles() );
        ChangeFile cf = (ChangeFile) entry.getFiles().get( 0 );
        assertEquals( "readme.txt", cf.getName() );
        assertTrue( cf.getRevision() != null && cf.getRevision().length() > 0 );
    }
View Full Code Here

        assertNotNull( entry.getFiles() );

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

        ChangeFile cf = (ChangeFile) 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

    }

    public void testCompareByNumberOfCommits()
    {
        List list1 = new ArrayList();
        list1.add( new ChangeFile( "anything" ) );

        List list2 = new ArrayList();

        assertTrue( "Test compare by commits, less than", comparator.compare( list1, list2 ) < 0 );

        list1 = new ArrayList();
        list1.add( new ChangeFile( "anything" ) );

        list2 = new ArrayList();
        list2.add( new ChangeFile( "one thing" ) );
        list2.add( new ChangeFile( "something") );

        assertTrue( "Test compare by commits, greater than", comparator.compare( list1, list2 ) > 0 );
    }
View Full Code Here

    }

    public void testCompareByRevision()
    {
        List list1 = new ArrayList();
        list1.add( new ChangeFile( "changefile-1", "123" ) );
        list1.add( new ChangeFile( "changefile-1", "234" ) );

        List list2 = new ArrayList();
        list2.add( new ChangeFile( "changefile-2", "246" ) );
        list2.add( new ChangeFile( "changefile-2", "468" ) );

        assertTrue( "Test compare by revision, less than", comparator.compare( list1, list2 ) < 0 );

        list1 = new ArrayList();
        list1.add( new ChangeFile( "changefile-1", "246" ) );
        list1.add( new ChangeFile( "changefile-1", "468" ) );

        list2 = new ArrayList();
        list2.add( new ChangeFile( "changefile-2", "123" ) );
        list2.add( new ChangeFile( "changefile-2", "234" ) );

        assertTrue( "Test compare by revision, greater than", comparator.compare( list1, list2 ) > 0 );
    }
View Full Code Here

TOP

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

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.