Class PerforceDescribeConsumer
java.lang.Object
org.apache.maven.scm.util.AbstractConsumer
org.apache.maven.scm.provider.perforce.command.changelog.PerforceDescribeConsumer
- All Implemented Interfaces:
org.codehaus.plexus.util.cli.StreamConsumer
Parse the tagged output from "p4 describe -s [change] [change] [...]".
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final StringThe changelist ends with a blank lineprivate static final StringThe comment section ends with a blank lineprivate ChangeSetThe current log entry being processed by the parserprivate Stringthe current file being processed by the parserprivate StringThe current log entry being processed by the parserprivate static final PatternThe regular expression used to match file pathsprivate static final intState machine constant: expecting "Affected files"private static final intState machine constant: expecting commentsprivate static final intState machine constant: eat the first blank lineprivate static final intState machine constant: expecting filesprivate static final intState machine constant: expecting blank lineprivate static final intState machine constant: expecting revisionprivate StringThe location of files within the Perforce depot that we are processing e.g.private static final PatternThe regular expression used to match header linesprivate intCurrent status of the parserprivate String -
Constructor Summary
ConstructorsConstructorDescriptionPerforceDescribeConsumer(String repoPath, String userDatePattern, ScmLogger logger) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidaddEntry(ChangeSet entry, ChangeFile file) Add a change log entry to the list (if it's not already there) with the given file.voidconsumeLine(String line) private voidProcess the current input line in the GET_COMMENT state.private voidprocessGetComment(String line) Process the current input line in the GET_COMMENT state.private voidprocessGetFile(String line) Each file matches the fileRegexp.private voidprocessGetRevision(String line) Most of the relevant info is on the revision line matching the 'pattern' string.Methods inherited from class org.apache.maven.scm.util.AbstractConsumer
getLogger, parseDate, parseDate, setLogger
-
Field Details
-
entries
-
GET_REVISION
private static final int GET_REVISIONState machine constant: expecting revision- See Also:
-
GET_COMMENT_BEGIN
private static final int GET_COMMENT_BEGINState machine constant: eat the first blank line- See Also:
-
GET_COMMENT
private static final int GET_COMMENTState machine constant: expecting comments- See Also:
-
GET_AFFECTED_FILES
private static final int GET_AFFECTED_FILESState machine constant: expecting "Affected files"- See Also:
-
GET_FILES_BEGIN
private static final int GET_FILES_BEGINState machine constant: expecting blank line- See Also:
-
GET_FILE
private static final int GET_FILEState machine constant: expecting files- See Also:
-
status
private int statusCurrent status of the parser -
currentRevision
The current log entry being processed by the parser -
currentChange
The current log entry being processed by the parser -
currentFile
the current file being processed by the parser -
repoPath
The location of files within the Perforce depot that we are processing e.g. //depot/projects/foo/bar -
userDatePattern
-
REVISION_PATTERN
The regular expression used to match header lines -
COMMENT_DELIMITER
The comment section ends with a blank line- See Also:
-
CHANGELIST_DELIMITER
The changelist ends with a blank line- See Also:
-
FILE_PATTERN
The regular expression used to match file paths
-
-
Constructor Details
-
PerforceDescribeConsumer
-
-
Method Details
-
getModifications
- Throws:
ScmException
-
consumeLine
-
addEntry
Add a change log entry to the list (if it's not already there) with the given file.- Parameters:
entry- aChangeSetto be added to the list if another with the same key (p4 change number) doesn't exist already.file- aChangeFileto be added to the entry
-
processGetFile
Each file matches the fileRegexp.- Parameters:
line- A line of text from the Perforce log output
-
processGetRevision
Most of the relevant info is on the revision line matching the 'pattern' string.- Parameters:
line- A line of text from the perforce log output
-
processGetComment
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 perforce log output
-
processGetAffectedFiles
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 perforce log output
-