/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* See LICENSE.txt included in this distribution for the specific
* language governing permissions and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at LICENSE.txt.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
/**
* Parse a stream of Git log comments.
*/
private enum ParseState {
}
/**
* Process the output from the log command and insert the HistoryEntries
* into the history field.
*
* @param input The output from the process
* @throws java.io.IOException If an error occurs while reading the stream
*/
try {
} finally {
}
}
}
while (s != null) {
if (s.startsWith("commit")) {
}
entry = new HistoryEntry();
// strip off the uuid if this is a git-svn repo. Per default
// git generates for unknown authors:
// ^Author: ${user} <${user}@${uuid}>
{
s = s.substring(0,
}
// TBD: Perhaps we should add this to the history entry as well
try {
} catch (ParseException pe) {
}
} else if (StringUtils.isOnlyWhitespace(s)) {
// We are done reading the heading, start to read the message
// The current line is empty - the message starts on the
// next line (to be parsed below).
}
}
int i = 0, k;
k = s.indexOf(' ', i);
if (i > 0 && k > 0) {
s = s.substring(i, k);
entry.setOldRevision(s);
} else {
i = 0;
}
}
if (i == 0) {
entry.appendMessage(s);
}
}
} else {
// This is the list of files after the message - add them
}
}
continue; // Parse this line again - do not read a new line
}
try {
} catch (FileNotFoundException e) { //NOPMD
// If the file is not located under the source root,
// ignore it (bug #11664).
}
}
}
}
// no commitDate found? Strange! Use authorDate than.
try {
} catch (ParseException pe) {
}
}
}
}
/**
* Parse the history for the specified file.
*
* @param file the file to parse history for
* @param repos Pointer to the SubversionReporitory
* @return object representing the file's history
*/
throws HistoryException
{
try {
if (status != 0) {
throw new HistoryException("Failed to get history for '"
}
} catch (IOException e) {
throw new HistoryException("Failed to get history for '" +
}
return history;
}
/**
* Parse the given string.
*
* @param buffer The string to be parsed
* @return The parsed history
* @throws IOException if we fail to parse the buffer
*/
return history;
}
}