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