history.jsp revision 7844262e5641bdb32f8bc179944dbb21401c5e76
1516N/A<%--
28N/ACDDL HEADER START
28N/A
28N/AThe contents of this file are subject to the terms of the
28N/ACommon Development and Distribution License (the "License").
28N/AYou may not use this file except in compliance with the License.
28N/A
28N/ASee LICENSE.txt included in this distribution for the specific
28N/Alanguage governing permissions and limitations under the License.
28N/A
28N/AWhen distributing Covered Code, include this CDDL HEADER in each
28N/Afile and include the License file at LICENSE.txt.
28N/AIf applicable, add the following below this CDDL HEADER, with the
28N/Afields enclosed by brackets "[]" replaced with your own identifying
28N/Ainformation: Portions Copyright [yyyy] [name of copyright owner]
28N/A
28N/ACDDL HEADER END
28N/A
28N/ACopyright 2005 Sun Microsystems, Inc. All rights reserved.
28N/AUse is subject to license terms.
28N/A
28N/Aident "@(#)history.jsp 1.1 05/11/11 SMI"
28N/A
2026N/A--%><%@ page import = "javax.servlet.*,
28N/Ajava.lang.*,
873N/Ajavax.servlet.http.*,
873N/Ajava.util.*,
873N/Ajava.io.*,
38N/Ajava.text.*,
2026N/Aorg.opensolaris.opengrok.analysis.*,
28N/Aorg.opensolaris.opengrok.web.*,
873N/Aorg.opensolaris.opengrok.history.*,
28N/Ajava.util.regex.*
1974N/A"
1755N/A%><%@include file="mast.jsp"%><%
1968N/Aif (path.length() > 0) {
289N/A boolean striked = false;
1431N/A String userPage = getInitParameter("USER_PAGE");
1974N/A String bugPage = getInitParameter("BUG_PAGE");
49N/A Pattern bugPattern = Pattern.compile("\\b([12456789][0-9]{6})\\b");
873N/A Format df = new SimpleDateFormat("dd-MMM-yyyy");
873N/A HistoryReader hr = null;
873N/A Date tstart = new Date();
873N/A if(isDir) {
873N/A String[] apaths = request.getParameterValues("also");
948N/A String apath = path;
948N/A if (apaths!= null && apaths.length>0) {
1516N/A StringBuilder paths = new StringBuilder(path);
873N/A for(int i=0; i< apaths.length; i++) {
1540N/A paths.append(' ');
1540N/A paths.append(apaths[i]);
1540N/A }
1540N/A apath = paths.toString();
1540N/A }
1540N/A hr = new DirectoryHistoryReader(getServletContext().getInitParameter("DATA_ROOT") + "/index", apath, getServletContext().getInitParameter("SRC_ROOT"));
873N/A } else {
873N/A hr = HistoryGuru.getInstance().getHistoryReader(rawSource + parent, basename);
873N/A }
873N/A if (hr != null) {
1431N/A
1431N/A%><form action="<%=context%>/diff<%=path%>">
1431N/A<table cellspacing="0" cellpadding="2" border="0" width="100%" class="src">
1431N/A<tr><td colspan="4"><span class="pagetitle">History log of <a href="<%= context +"/xref" + path %>"><%=basename%></a></span></td></tr>
1431N/A<tr class="thead"><%
873N/Aif(!isDir) {
873N/A%><td>Revision</td><th><input type="submit" value=" Compare "/></th><%
873N/A}
873N/A%><td>Date</td><td>Author</td><td>Comments</td></tr><%
873N/Aboolean alt = true;
873N/Awhile (hr.next()) {
873N/A String rev = hr.getRevision();
873N/A alt = !alt;
873N/A%><tr valign="top" <%= alt ? "class=\"alt\"" : "" %>><%
873N/Aif(!isDir) {
1516N/A if(hr.isActive()) {
873N/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%>"/>
1516N/A<input type="radio" name="r2" value="<%=rev%>"/></td><%
873N/A } else {
1516N/A striked = true;
873N/A %><td><strike>&nbsp;<%=rev%>&nbsp; </strike></td><td>&nbsp;</td><%
873N/A }
1516N/A}
873N/A%><td><%= df.format(hr.getDate()) %>&nbsp;</td>
873N/A<td>
873N/A<%
873N/A
873N/Aif(userPage != null && ! userPage.equals("")) {
873N/A %><a href="<%= userPage + hr.getAuthor() %>"><%= hr.getAuthor() %></a><%
873N/A} else {
28N/A %><%= hr.getAuthor() %><%
873N/A}
1516N/A
873N/A%>&nbsp;</td><td><%=
873N/A(bugPage != null && ! bugPage.equals("")) ?
873N/A bugPattern.matcher(Util.Htmlize(hr.getComment())).replaceAll("<a href=\"" + bugPage + "$1\">$1</a>")
1516N/A : Util.Htmlize(hr.getComment())
1516N/A%><%
1516N/AArrayList files = hr.getFiles();
1516N/Aif(files != null) {%><br/><%
873N/A Iterator ifiles = files.iterator();
873N/A while(ifiles.hasNext()) {
1516N/A String ifile = (String)ifiles.next();
1516N/A String jfile = ifile.startsWith(path) ? ifile.substring(path.length()+1) : ifile;
873N/A %><a class="h" href="<%=context%>/xref<%=ifile%>"><%=jfile%></a><br/><%
873N/A }
873N/A}
873N/A%></td></tr><%
1516N/A}
873N/A %></table></form><%
1516N/A hr.close();
873N/A if(striked) {
948N/A %><p><b>Note:</b> No associated file changes are available for revisions with strike-through numbers (eg. <strike>1.45</strike>)</p><%
1431N/A }
1431N/A %><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><%
1431N/A } else {
1431N/A response.sendError(404, "No history");
1431N/A }
948N/A}
948N/A%><%@include file="foot.html"%>
948N/A