use of org.apache.commons.jrcs.rcs.InvalidFileFormatException in project OpenGrok by OpenGrok.
the class RCSRepository method annotate.
static Annotation annotate(File file, String revision, File rcsFile) throws IOException {
try {
Archive archive = new Archive(rcsFile.getPath());
// If revision is null, use current revision
Version version = revision == null ? archive.getRevisionVersion() : archive.getRevisionVersion(revision);
// Get the revision with annotation
archive.getRevision(version, true);
Annotation a = new Annotation(file.getName());
// considered public API anymore, but it works.
for (Node n : archive.getRevisionNodes()) {
String rev = n.getVersion().toString();
String author = n.getAuthor();
a.addLine(rev, author, true);
}
return a;
} catch (ParseException pe) {
throw wrapInIOException("Parse exception annotating RCS repository", pe);
} catch (InvalidFileFormatException iffe) {
throw wrapInIOException("File format exception annotating RCS repository", iffe);
} catch (PatchFailedException pfe) {
throw wrapInIOException("Patch failed exception annotating RCS repository", pfe);
}
}
Aggregations