history.jsp revision 9742fcb09163b2462ffe159eeea6a107306cf772
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox UserCDDL HEADER START
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox UserThe contents of this file are subject to the terms of the
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox UserCommon Development and Distribution License (the "License").
5347c0fcb04eaea19d9f39795646239f487c6207Tinderbox UserYou may not use this file except in compliance with the License.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterSee LICENSE.txt included in this distribution for the specific
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterlanguage governing permissions and limitations under the License.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterWhen distributing Covered Code, include this CDDL HEADER in each
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userfile and include the License file at LICENSE.txt.
14a656f94b1fd0ababd84a772228dfa52276ba15Evan HuntIf applicable, add the following below this CDDL HEADER, with the
cd32f419a8a5432fbb139f56ee73cbf68b9350ccTinderbox Userfields enclosed by brackets "[]" replaced with your own identifying
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Huntinformation: Portions Copyright [yyyy] [name of copyright owner]
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterCDDL HEADER END
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterCopyright 2005 Sun Microsystems, Inc. All rights reserved.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic UpdaterUse is subject to license terms.
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterident "@(#)history.jsp 1.1 05/11/11 SMI"
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt--%><%@ page import = "javax.servlet.*,
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater%><%@include file="mast.jsp"%><%
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox Userif (path.length() > 0 && valid) {
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater boolean striked = false;
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User String userPage = environment.getUserPage();
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater String bugPage = environment.getBugPage();
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User String bugRegex = environment.getBugPattern();
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User if(bugRegex == null || bugRegex.equals("")) {
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User bugRegex = "\\b([12456789][0-9]{6})\\b";
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User Pattern bugPattern = Pattern.compile(bugRegex);
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt String reviewPage = environment.getReviewPage();
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater String reviewRegex = environment.getReviewPattern();
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User if(reviewRegex == null || reviewRegex.equals("")) {
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater reviewRegex = "\\b(\\d{4}/\\d{3})\\b";
9d557856c2a19ec95ee73245f60a92f8675cf5baTinderbox User Pattern reviewPattern = Pattern.compile(reviewRegex);
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater Format df = new SimpleDateFormat("dd-MMM-yyyy");
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt Date tstart = new Date();
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater File f = new File(rawSource + path);
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater if (!HistoryGuru.getInstance().hasHistory(f)) {
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater response.sendError(404, "No history");
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater HistoryReader hr = HistoryGuru.getInstance().getHistoryReader(f);
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User if (hr == null) {
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt response.sendError(404, "No history");
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater%><form action="<%=context%>/diff<%=path%>">
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater<table cellspacing="0" cellpadding="2" border="0" width="100%" class="src">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User <td colspan="4"><span class="pagetitle">History log of <a href="<%= context +"/xref" + path %>"><%=path%></a></span></td>
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User<tr class="thead">
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User <td>Revision</td><%
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User if (!isDir) {
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater %><th><input type="submit" value=" Compare "/></th><%
fd2597f75693a2279fdf588bd40dfe2407c42028Tinderbox User %><td>Date</td><td>Author</td><td>Comments</td>
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updaterboolean alt = true;
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater if (rev == null || rev.length() == 0) {
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User %><tr valign="top" <%= alt ? "class=\"alt\"" : "" %>><%
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater %><td> <%=rev%> </td><%
14a656f94b1fd0ababd84a772228dfa52276ba15Evan Hunt String rp = ((hr.getSourceRootPath() == null) ? path : hr.getSourceRootPath().toString());
b6b8f8a0362da8c749021c4b6376cfb96047912bTinderbox User%><td> <a name="<%=rev%>" href="<%= context +"/xref" + rp + "?r=" + Util.URIEncode(rev) %>"><%=rev%></a> </td><td align="center"><input type="radio" name="r1" value="<%=rp%>@<%=rev%>"/>
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater<input type="radio" name="r2" value="<%=rp%>@<%=rev%>"/></td><%
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater striked = true;
fc2381b901eb162810f54a11cc512b95f55a60dfAutomatic Updater %><td><strike> <%=rev%> </strike></td><td> </td><%
Date date = hr.getDate();
%><%=df.format(date)%><%
if(userPage != null && ! userPage.equals("")) {
%><%= hr.getAuthor() %><%
if (bugPage != null && ! bugPage.equals("")) {
cout=bugPattern.matcher(cout).replaceAll("<a href=\"" + bugPage + "$1\">$1</a>"); }
if (reviewPage != null && ! reviewPage.equals("")) {
cout=reviewPattern.matcher(cout).replaceAll("<a href=\"" + reviewPage + "$1\">$1</a>"); }
List<String> files = hr.getFiles();
jfile = ifile.substring(1);
hr.close();
%><p><b>Note:</b> No associated file changes are available for revisions with strike-through numbers (eg. <strike>1.45</strike>)</p><%
%><p class="rssbadge"><a href="<%=context%>/rss<%=Util.URIEncodePath(path)%>"><img src="<%=context%>/<%=environment.getWebappLAF()%>/img/rss.png" width="80" height="15" alt="RSS XML Feed" title="RSS XML Feed of latest changes"/></a></p><%
%><%@include file="foot.jspf"%>