Examples of BlameLine


Examples of org.apache.maven.scm.command.blame.BlameLine

        throws Exception
    {
        GitBlameConsumer consumer = consumeFile( "/src/test/resources/git/blame/git-blame-different-author.out" );

        Assert.assertEquals( 93, consumer.getLines().size() );
        BlameLine blameLine = consumer.getLines().get( 0 );
        Assert.assertNotNull( blameLine );
        Assert.assertEquals( "39574726d20f62023d39311e6032c7ab0a9d3cdb", blameLine.getRevision() );
        Assert.assertEquals( "Mark Struberg", blameLine.getAuthor() );
        Assert.assertEquals( "Mark Struberg", blameLine.getCommitter() );

        blameLine = consumer.getLines().get( 12 );
        Assert.assertNotNull( blameLine );
        Assert.assertEquals( "41e5bc05953781a5702f597a1a36c55371b517d3", blameLine.getRevision() );
        Assert.assertEquals( "Another User", blameLine.getAuthor() );
        Assert.assertEquals( "Mark Struberg", blameLine.getCommitter() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

        {
            if ( !consumerLineIt.hasNext() )
            {
                fail( "GitBlameConsumer lines do not match the original output!" );
            }
            BlameLine blameLine = consumerLineIt.next();
            Assert.assertNotNull( blameLine );

            String[] parts = line.split( "\t" );
            Assert.assertEquals( 3, parts.length );

            Assert.assertEquals( "error in line " + lineNr, parts[0], blameLine.getRevision() );
            Assert.assertEquals( "error in line " + lineNr, parts[1], blameLine.getAuthor() );
            Assert.assertEquals( "error in line " + lineNr, parts[2], blameDateFormat.format( blameLine.getDate() ) );

            lineNr ++;
        }

        if ( consumerLineIt.hasNext() )
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

        AccuRevJUnitUtil.consume("/annotate.txt", consumer);

        Assert.assertEquals(12, consumer.getLines().size());

        BlameLine line1 = (BlameLine) consumer.getLines().get(0);
        Assert.assertEquals("2", line1.getRevision());
        Assert.assertEquals("godin", line1.getAuthor());
        assertThat(line1.getDate(), is(AccuRev.ACCUREV_TIME_SPEC.parse("2008/10/26 16:26:44")));

        BlameLine line12 = (BlameLine) consumer.getLines().get(11);
        Assert.assertEquals("1", line12.getRevision());
        Assert.assertEquals("godin", line12.getAuthor());
        assertThat(line12.getDate(), is(AccuRev.ACCUREV_TIME_SPEC.parse("2008/10/17 11:41:50")));

    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

        final File file = new File( "src/main/java/Foo.java" );
        final ScmFileSet testFileSet = new ScmFileSet( basedir, file );

        final Date date = new Date();
        final BlameLine blameLine = new BlameLine( date, "12", "theAuthor" );

        when( accurev.annotate( basedir, file ) ).thenReturn( Collections.singletonList( blameLine ) );

        AccuRevBlameCommand command = new AccuRevBlameCommand( getLogger() );
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

        String revision = annotation.trim();

        Date date = parseDate( dateStr, null, BAZAAR_TIMESTAMP_PATTERN );

        lines.add( new BlameLine( date, revision, author ) );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

            s = in.readLine();
        }

        Assert.assertEquals( 3, consumer.getLines().size() );

        BlameLine line1 = (BlameLine) consumer.getLines().get( 0 );
        Assert.assertEquals( "3", line1.getRevision() );
        Assert.assertEquals( "hatusr01", line1.getAuthor() );

        BlameLine line2 = (BlameLine) consumer.getLines().get( 1 );
        Assert.assertEquals( "4", line2.getRevision() );
        Assert.assertEquals( "buckh", line2.getAuthor() );
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

            if ( parts.length >= 1)
            {
                revision = parts[0];

                BlameLine oldLine = commitInfo.get( revision );

                if ( oldLine != null )
                {
                    // restore the commit info
                    author    = oldLine.getAuthor();
                    committer = oldLine.getCommitter();
                    time      = oldLine.getDate();
                }

                expectRevisionLine = false;
            }
        }
        else
        {
            if ( line.startsWith( GIT_AUTHOR ) )
            {
                author = line.substring( GIT_AUTHOR.length() );
                return;
            }

            if ( line.startsWith( GIT_COMMITTER ) )
            {
                committer = line.substring( GIT_COMMITTER.length() );
                return;
            }

            if ( line.startsWith( GIT_COMMITTER_TIME ) )
            {
                String timeStr = line.substring( GIT_COMMITTER_TIME.length() );
                time = new Date( Long.parseLong( timeStr ) * 1000L );
                return;
            }


            if ( line.startsWith( "\t" ) )
            {
                // this is the content line.
                // we actually don't need the content, but this is the right time to add the blame line
                BlameLine blameLine = new BlameLine( time, revision, author, committer );
                getLines().add( blameLine );

                // keep commitinfo for this sha-1
                commitInfo.put( revision, blameLine );

View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

                String revision = lineRegexp.getParen( 1 ).trim();
                String author = lineRegexp.getParen( 2 ).trim();
                String dateTimeStr = lineRegexp.getParen( 3 ).trim();

                Date dateTime = parseDate( dateTimeStr, null, CVS_TIMESTAMP_PATTERN, Locale.US );
                lines.add( new BlameLine( dateTime, revision, author ) );

                if ( getLogger().isDebugEnabled() )
                {
                    getLogger().debug( author + " " + dateTimeStr );
                }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

    {
        if ( lineRegexp.match( line ) )
        {
            String revision = lineRegexp.getParen( 1 ).trim();

            lines.add( new BlameLine( null, revision, null ) );
        }
    }
View Full Code Here

Examples of org.apache.maven.scm.command.blame.BlameLine

            String author = matcher.group( 2 ).trim();
            String dateStr = matcher.group( 3 ).trim();

            Date date = parseDate( dateStr, null, AccuRev.ACCUREV_TIME_FORMAT_STRING );

            lines.add( new BlameLine( date, revision, author ) );
        }
        else
        {
            throw new RuntimeException( "Unable to parse annotation from line: " + line );
        }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.