history.jsp revision 50
293N/A<%--
293N/ACDDL HEADER START
293N/A
293N/AThe contents of this file are subject to the terms of the
293N/ACommon Development and Distribution License (the "License").
293N/AYou may not use this file except in compliance with the License.
293N/A
293N/ASee LICENSE.txt included in this distribution for the specific
293N/Alanguage governing permissions and limitations under the License.
293N/A
293N/AWhen distributing Covered Code, include this CDDL HEADER in each
293N/Afile and include the License file at LICENSE.txt.
293N/AIf applicable, add the following below this CDDL HEADER, with the
293N/Afields enclosed by brackets "[]" replaced with your own identifying
293N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
293N/A
293N/ACDDL HEADER END
293N/A
293N/ACopyright 2005 Sun Microsystems, Inc. All rights reserved.
293N/AUse is subject to license terms.
293N/A
293N/Aident "@(#)history.jsp 1.1 05/11/11 SMI"
3996N/A
293N/A--%><%@ page import = "javax.servlet.*,
293N/Ajava.lang.*,
293N/Ajavax.servlet.http.*,
293N/Ajava.util.*,
293N/Ajava.io.*,
293N/Ajava.text.*,
293N/Aorg.opensolaris.opengrok.analysis.*,
1191N/Aorg.opensolaris.opengrok.web.*,
293N/Aorg.opensolaris.opengrok.history.*,
293N/Ajava.util.regex.*
293N/A"
844N/A%><%@include file="mast.jsp"%><%
1191N/Aif (path.length() > 0 && valid) {
293N/A boolean striked = false;
1273N/A String userPage = getInitParameter("USER_PAGE");
293N/A String bugPage = getInitParameter("BUG_PAGE");
3661N/A Pattern bugPattern = Pattern.compile("\\b([12456789][0-9]{6})\\b");
3661N/A Format df = new SimpleDateFormat("dd-MMM-yyyy");
3996N/A Date tstart = new Date();
3996N/A File f = new File(rawSource + path);
293N/A HistoryReader hr = HistoryGuru.getInstance().getHistoryReader(f);
4374N/A
4374N/A if (hr == null) {
4374N/A response.sendError(404, "No history");
4374N/A return;
4374N/A }
293N/A
293N/A%><form action="<%=context%>/diff<%=path%>">
293N/A<table cellspacing="0" cellpadding="2" border="0" width="100%" class="src">
293N/A<tr><td colspan="4"><span class="pagetitle">History log of <a href="<%= context +"/xref" + path %>"><%=path%></a></span></td></tr>
293N/A<tr class="thead"><%
293N/Aif(!isDir) {
293N/A%><td>Revision</td><th><input type="submit" value=" Compare "/></th><%
293N/A}
293N/A%><td>Date</td><td>Author</td><td>Comments</td></tr><%
293N/Aboolean alt = true;
293N/Awhile (hr.next()) {
716N/A String rev = hr.getRevision();
293N/A alt = !alt;
293N/A%><tr valign="top" <%= alt ? "class=\"alt\"" : "" %>><%
293N/Aif(!isDir) {
293N/A if(hr.isActive()) {
293N/A%><td>&nbsp;<a name="<%=rev%>" href="<%= context +"/xref" + path + "?r=" + rev %>"><%=rev%></a>&nbsp;</td><td align="center"><input type="radio" name="r1" value="<%=rev%>"/>
293N/A<input type="radio" name="r2" value="<%=rev%>"/></td><%
293N/A } else {
293N/A striked = true;
293N/A %><td><strike>&nbsp;<%=rev%>&nbsp; </strike></td><td>&nbsp;</td><%
3996N/A }
3996N/A}
3996N/A%><td><%= df.format(hr.getDate()) %>&nbsp;</td>
<td>
<%
if(userPage != null && ! userPage.equals("")) {
%><a href="<%= userPage + hr.getAuthor() %>"><%= hr.getAuthor() %></a><%
} else {
%><%= hr.getAuthor() %><%
}
%>&nbsp;</td><td><%=
(bugPage != null && ! bugPage.equals("")) ?
bugPattern.matcher(Util.Htmlize(hr.getComment())).replaceAll("<a href=\"" + bugPage + "$1\">$1</a>")
: Util.Htmlize(hr.getComment())
%><%
List<String> files = hr.getFiles();
if(files != null) {%><br/><%
for (String ifile : files) {
String jfile = ifile;
if ("/".equals(path)) {
jfile = ifile.substring(1);
} else if (ifile.startsWith(path)) {
jfile = ifile.substring(path.length()+1);
}
%><a class="h" href="<%=context%>/xref<%=ifile%>"><%=jfile%></a><br/><%
}
}
%></td></tr><%
}
%></table></form><%
hr.close();
if(striked) {
%><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<%=path%>"><img src="<%=context%>/img/rss.png" width="80" height="15" alt="RSS XML Feed" title="RSS XML Feed of latest changes"/></a></p><%
}
%><%@include file="foot.jsp"%>