Class SvnChangeLogConsumer
- java.lang.Object
-
- org.apache.maven.scm.util.AbstractConsumer
-
- org.apache.maven.scm.provider.svn.svnexe.command.changelog.SvnChangeLogConsumer
-
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
public class SvnChangeLogConsumer extends AbstractConsumer
-
-
Field Summary
Fields Modifier and Type Field Description private static intAUTHOR_GROUPprivate static java.lang.StringCOMMENT_END_TOKENThe comment section ends with a dashed line.private SvnChangeSetcurrentChangeThe current log entry being processed by the parser.private java.lang.StringBuildercurrentCommentThe current comment of the entry being processed by the parser.private java.lang.StringcurrentRevisionThe current revision of the entry being processed by the parser.private static intDATE_GROUPprivate static java.util.regex.PatternDATE_REG_EXPprivate java.util.List<ChangeSet>entriesList of change log entries.private static java.lang.StringFILE_END_TOKENThe file section ends with a blank line.private static java.util.regex.PatternFILE_PATTERNThere is always action and affected path; when copying/moving, recognize also original path and revision.private static intGET_COMMENTState machine constant: expecting comments.private static intGET_FILEState machine constant: expecting file information.private static intGET_HEADERState machine constant: expecting header.private static java.util.regex.PatternHEADER_REG_EXPThe regular expression used to match header lines.private static java.util.regex.PatternORIG_FILE_PATTERNThis matches the 'original file info' part of the complete file line.private static intREVISION_GROUPprivate static java.util.regex.PatternREVISION_REG_EXP1private static java.util.regex.PatternREVISION_REG_EXP2private intstatusCurrent status of the parser.private static java.lang.StringSVN_TIMESTAMP_PATTERNDate formatter for svn timestamp (after a little massaging)private java.lang.StringuserDateFormat-
Fields inherited from class org.apache.maven.scm.util.AbstractConsumer
logger
-
-
Constructor Summary
Constructors Constructor Description SvnChangeLogConsumer(java.lang.String userDateFormat)Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconsumeLine(java.lang.String line)private java.util.DategetDate(java.lang.String dateOutput)Converts the date time stamp from the svn output into a date object.java.util.List<ChangeSet>getModifications()private java.lang.StringgetRevision(java.lang.String revisionOutput)Gets the svn revision, from the svn log revision output.private voidprocessGetComment(java.lang.String line)Process the current input line in the GET_COMMENT state.private voidprocessGetFile(java.lang.String line)Process the current input line in the GET_FILE state.private voidprocessGetHeader(java.lang.String line)Process the current input line in the GET_HEADER state.-
Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
parseDate, parseDate
-
-
-
-
Field Detail
-
SVN_TIMESTAMP_PATTERN
private static final java.lang.String SVN_TIMESTAMP_PATTERN
Date formatter for svn timestamp (after a little massaging)- See Also:
- Constant Field Values
-
GET_HEADER
private static final int GET_HEADER
State machine constant: expecting header.- See Also:
- Constant Field Values
-
GET_FILE
private static final int GET_FILE
State machine constant: expecting file information.- See Also:
- Constant Field Values
-
GET_COMMENT
private static final int GET_COMMENT
State machine constant: expecting comments.- See Also:
- Constant Field Values
-
FILE_PATTERN
private static final java.util.regex.Pattern FILE_PATTERN
There is always action and affected path; when copying/moving, recognize also original path and revision.
-
ORIG_FILE_PATTERN
private static final java.util.regex.Pattern ORIG_FILE_PATTERN
This matches the 'original file info' part of the complete file line. Note the use of [:alpha:] instead of literal 'from' - this is meant to allow non-English localizations.
-
FILE_END_TOKEN
private static final java.lang.String FILE_END_TOKEN
The file section ends with a blank line.- See Also:
- Constant Field Values
-
COMMENT_END_TOKEN
private static final java.lang.String COMMENT_END_TOKEN
The comment section ends with a dashed line.- See Also:
- Constant Field Values
-
status
private int status
Current status of the parser.
-
entries
private final java.util.List<ChangeSet> entries
List of change log entries.
-
currentChange
private SvnChangeSet currentChange
The current log entry being processed by the parser.
-
currentRevision
private java.lang.String currentRevision
The current revision of the entry being processed by the parser.
-
currentComment
private java.lang.StringBuilder currentComment
The current comment of the entry being processed by the parser.
-
HEADER_REG_EXP
private static final java.util.regex.Pattern HEADER_REG_EXP
The regular expression used to match header lines.
-
REVISION_GROUP
private static final int REVISION_GROUP
- See Also:
- Constant Field Values
-
AUTHOR_GROUP
private static final int AUTHOR_GROUP
- See Also:
- Constant Field Values
-
DATE_GROUP
private static final int DATE_GROUP
- See Also:
- Constant Field Values
-
REVISION_REG_EXP1
private static final java.util.regex.Pattern REVISION_REG_EXP1
-
REVISION_REG_EXP2
private static final java.util.regex.Pattern REVISION_REG_EXP2
-
DATE_REG_EXP
private static final java.util.regex.Pattern DATE_REG_EXP
-
userDateFormat
private final java.lang.String userDateFormat
-
-
Method Detail
-
getModifications
public java.util.List<ChangeSet> getModifications()
-
consumeLine
public void consumeLine(java.lang.String line)
-
processGetHeader
private void processGetHeader(java.lang.String line)
Process the current input line in the GET_HEADER state. The author, date, and the revision of the entry are gathered. Note, Subversion does not have per-file revisions, instead, the entire repository is given a single revision number, which is used for the revision number of each file.- Parameters:
line- a line of text from the svn log output
-
getRevision
private java.lang.String getRevision(java.lang.String revisionOutput)
Gets the svn revision, from the svn log revision output.- Parameters:
revisionOutput-- Returns:
- the svn revision
-
processGetFile
private void processGetFile(java.lang.String line)
Process the current input line in the GET_FILE state. This state adds each file entry line to the current change log entry. Note, the revision number for the entire entry is used for the revision number of each file.- Parameters:
line- a line of text from the svn log output
-
processGetComment
private void processGetComment(java.lang.String line)
Process the current input line in the GET_COMMENT state. This state gathers all of the comments that are part of a log entry.- Parameters:
line- a line of text from the svn log output
-
getDate
private java.util.Date getDate(java.lang.String dateOutput)
Converts the date time stamp from the svn output into a date object.- Parameters:
dateOutput- the date output from an svn log command- Returns:
- a date representing the time stamp of the log entry
-
-