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