String diff = null ;
try {
diff = getCvsManager().diff(name);
} catch (CvsException cvs_ex) {
Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
HtmlGenerator g = getHtmlGenerator("CVS diff command failed") ;
g.append ("<p>The CVS <strong>diff</strong> command failed "
+ " on " + name
+ " with the following error message: "
+ "<em>" + cvs_ex.getMessage() + "</em>"
+ "<hr> from class: " + this.getClass().getName()) ;
error.setStream (g) ;
throw new HTTPException (error) ;
} catch (InvalidResourceException ex) {
Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
HtmlGenerator g = getHtmlGenerator("CVS diff command failed") ;
g.append ("<p>The CVS <strong>diff</strong> command failed "
+ " on " + name
+ " with the following error message: "
+ "<em>" + ex.getMessage() + "</em>"
+ "<hr> from class: " + this.getClass().getName()) ;
error.setStream (g) ;
throw new HTTPException (error) ;
} finally {
rr_cvsframe.unlock();
}
// if there are no differences, generate a dummy report
Reply reply = request.makeReply(HTTP.OK) ;
if((diff == null) || (diff.length() == 0)) {
HtmlGenerator g = getHtmlGenerator("CVS diff command results");
g.append("<P>No differences between " + name
+ " and the repository</P>");
reply.setStream(g);
} else {
HtmlGenerator g = getHtmlGenerator("Diff result");
g.append ("<center>");
g.append (" [ <a href=\"../\">Up to directory</A> ] ·");
g.append (" [ <a href=\""+getCvsURL(),
"\">Back to CVS</A> ] \n");
g.append ("</center>");
g.append ("<hr noshade width=\"80%\"><p>");
g.append ("<span class=\"title\"> CVS diff of ",
name,"</span>\n");
g.append ("<pre>",parseDiff(diff),"</pre>\n");
g.append ("<p><hr noshade width=\"80%\">");
g.append ("<center>");
g.append (" [ <a href=\"../\">Up to directory</A> ] ·");
g.append (" [ <a href=\""+getCvsURL(),
"\">Back to CVS</A> ] \n");
g.append ("</center>");
reply.setStream(g);
}
return reply ;
}