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