String comment = data.getValue("comment");
if (revision == null) {
Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
error.setContent("No revision selected !");
throw new HTTPException (error) ;
} else if (comment == null) {
Reply error = request.makeReply(HTTP.BAD_REQUEST) ;
error.setContent("Empty comment not allowed.");
throw new HTTPException (error) ;
}
try {
String command[] = new String[2];
command[0] = "-m"+revision+":\""+comment+"\"";
command[1] = name;
getCvsManager().admin(command);
} catch (CvsException ex) {
Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR) ;
HtmlGenerator g =
getHtmlGenerator("CVS admin command failed") ;
g.append ("<p>The CVS <strong>admin</strong> command failed "
+ " on " + name
+ " with the following error message: "
+ "<em>" + ex.getMessage() + "</em>");
error.setStream (g) ;
throw new HTTPException (error) ;
} catch (InvalidResourceException inv_ex) {
Reply error = request.makeReply(HTTP.INTERNAL_SERVER_ERROR);
error.setContent("CvsFrame invalid");
return error;
}