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