public class PerforceDescribeConsumer extends AbstractConsumer
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
CHANGELIST_DELIMITER
The changelist ends with a blank line
|
private static java.lang.String |
COMMENT_DELIMITER
The comment section ends with a blank line
|
private ChangeSet |
currentChange
The current log entry being processed by the parser
|
private java.lang.String |
currentFile
the current file being processed by the parser
|
private java.lang.String |
currentRevision
The current log entry being processed by the parser
|
private java.util.List<ChangeSet> |
entries |
private static java.util.regex.Pattern |
FILE_PATTERN
The regular expression used to match file paths
|
private static int |
GET_AFFECTED_FILES
State machine constant: expecting "Affected files"
|
private static int |
GET_COMMENT
State machine constant: expecting comments
|
private static int |
GET_COMMENT_BEGIN
State machine constant: eat the first blank line
|
private static int |
GET_FILE
State machine constant: expecting files
|
private static int |
GET_FILES_BEGIN
State machine constant: expecting blank line
|
private static int |
GET_REVISION
State machine constant: expecting revision
|
private java.lang.String |
repoPath
The location of files within the Perforce depot that we are processing
e.g.
|
private static java.util.regex.Pattern |
REVISION_PATTERN
The regular expression used to match header lines
|
private int |
status
Current status of the parser
|
private java.lang.String |
userDatePattern |
Constructor and Description |
---|
PerforceDescribeConsumer(java.lang.String repoPath,
java.lang.String userDatePattern,
ScmLogger logger) |
Modifier and Type | Method and Description |
---|---|
private void |
addEntry(ChangeSet entry,
ChangeFile file)
Add a change log entry to the list (if it's not already there)
with the given file.
|
void |
consumeLine(java.lang.String line) |
java.util.List<ChangeSet> |
getModifications() |
private void |
processGetAffectedFiles(java.lang.String line)
Process the current input line in the GET_COMMENT state.
|
private void |
processGetComment(java.lang.String line)
Process the current input line in the GET_COMMENT state.
|
private void |
processGetFile(java.lang.String line)
Each file matches the fileRegexp.
|
private void |
processGetRevision(java.lang.String line)
Most of the relevant info is on the revision line matching the
'pattern' string.
|
getLogger, parseDate, parseDate, setLogger
private java.util.List<ChangeSet> entries
private static final int GET_REVISION
private static final int GET_COMMENT_BEGIN
private static final int GET_COMMENT
private static final int GET_AFFECTED_FILES
private static final int GET_FILES_BEGIN
private static final int GET_FILE
private int status
private java.lang.String currentRevision
private ChangeSet currentChange
private java.lang.String currentFile
private java.lang.String repoPath
private java.lang.String userDatePattern
private static final java.util.regex.Pattern REVISION_PATTERN
private static final java.lang.String COMMENT_DELIMITER
private static final java.lang.String CHANGELIST_DELIMITER
private static final java.util.regex.Pattern FILE_PATTERN
public PerforceDescribeConsumer(java.lang.String repoPath, java.lang.String userDatePattern, ScmLogger logger)
public java.util.List<ChangeSet> getModifications() throws ScmException
ScmException
public void consumeLine(java.lang.String line)
private void addEntry(ChangeSet entry, ChangeFile file)
entry
- a ChangeSet
to be added to the list if another
with the same key (p4 change number) doesn't exist already.file
- a ChangeFile
to be added to the entryprivate void processGetFile(java.lang.String line)
line
- A line of text from the Perforce log outputprivate void processGetRevision(java.lang.String line)
line
- A line of text from the perforce log outputprivate void processGetComment(java.lang.String line)
line
- a line of text from the perforce log outputprivate void processGetAffectedFiles(java.lang.String line)
line
- a line of text from the perforce log output