/*
* 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 Bazaar log comments.
*/
this.repository = repository;
}
try {
if (status != 0) {
throw new HistoryException("Failed to get history for: \"" +
}
} catch (IOException e) {
throw new HistoryException("Failed to get history for: \"" +
}
// If a changeset to start from is specified, remove that changeset
// from the list, since only the ones following it should be returned.
// Also check that the specified changeset was found, otherwise throw
// an exception.
if (sinceRevision != null) {
}
}
/**
* 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
*/
String s;
int state = 0;
if ("------------------------------------------------------------".equals(s)) {
}
entry = new HistoryEntry();
state = 0;
continue;
}
switch (state) {
case 0:
// First, go on until revno is found.
if (s.startsWith("revno:")) {
++state;
}
break;
case 1:
// Then, look for committer.
if (s.startsWith("committer:")) {
++state;
}
break;
case 2:
// And then, look for timestamp.
if (s.startsWith("timestamp:")) {
try {
} catch (ParseException e) {
"Failed to parse history timestamp:" + s, e);
}
++state;
}
break;
case 3:
// Expect the commit message to follow immediately after
// the timestamp, and that everything up to the list of
// modified, added and removed files is part of the commit
// message.
++state;
} else if (s.startsWith(" ")) {
// Commit messages returned by bzr log -v are prefixed
// with two blanks.
}
break;
case 4:
// Finally, store the list of modified, added and removed
// files. (Except the labels.)
// The list of files is prefixed with blanks.
s = s.trim();
if (idx != -1) {
}
}
break;
default:
break;
}
}
}
}
/**
* Parse the given string.
*
* @param buffer The string to be parsed
* @return The parsed history
* @throws IOException if we fail to parse the buffer
*/
}
}