history.jsp revision 3ba66fbb56ef22f183da783a1b2718280c357a4e
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibCDDL HEADER START
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibThe contents of this file are subject to the terms of the
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibCommon Development and Distribution License (the "License").
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibYou may not use this file except in compliance with the License.
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. CruzSee LICENSE.txt included in this distribution for the specific
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdiblanguage governing permissions and limitations under the License.
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibWhen distributing Covered Code, include this CDDL HEADER in each
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibfile and include the License file at LICENSE.txt.
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibIf applicable, add the following below this CDDL HEADER, with the
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibfields enclosed by brackets "[]" replaced with your own identifying
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibinformation: Portions Copyright [yyyy] [name of copyright owner]
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibCDDL HEADER END
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibCopyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibPortions Copyright 2011 Jens Elkner.
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib--%><%@page import="
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdiborg.opensolaris.opengrok.configuration.RuntimeEnvironment"
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdibinclude file="mast.jsp"
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib%><%/* ---------------------- history.jsp start --------------------- */
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib PageConfig cfg = PageConfig.get(request);
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib String path = cfg.getPath();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib String context = request.getContextPath();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib RuntimeEnvironment env = cfg.getEnv();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz String uriEncodedName = cfg.getUriEncodedPath();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz boolean striked = false;
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz String userPage = env.getUserPage();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz String userPageSuffix = env.getUserPageSuffix();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz if (userPageSuffix == null) {
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz // Set to empty string so we can append it to the URL
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak // unconditionally later.
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak userPageSuffix = "";
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak String bugPage = env.getBugPage();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz String bugRegex = env.getBugPattern();
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz if (bugRegex == null || bugRegex.equals("")) {
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz bugRegex = "\\b([12456789][0-9]{6})\\b";
cc618cb0faf84b6f5ab2cc9802b29d03f6a22f97Jon A. Cruz Pattern bugPattern = Pattern.compile(bugRegex);
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak String reviewPage = env.getReviewPage();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib String reviewRegex = env.getReviewPattern();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib if(reviewRegex == null || reviewRegex.equals("")) {
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen reviewRegex = "\\b(\\d{4}/\\d{3})\\b";
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib Pattern reviewPattern = Pattern.compile(reviewRegex);
9dc68827cbd515262ecb8d5ae8547d9e82c72e00Jon A. Cruz Format df = new SimpleDateFormat("dd-MMM-yyyy");
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould History hist=null;
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould hist = HistoryGuru.getInstance().getHistory(f);
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould } catch (Exception e) {
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould // should not happen
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould %><h3>Problem</h3><p class="error"><%= e.getMessage() %></p><%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould if (hist != null) {
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould%><script type="text/javascript">/* <![CDATA[ */
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Goulddocument.domReady.push(function() {domReadyHistory();});
8a0a34615f080ecd1c09986d8963d6afe5937a25Jon A. Cruz/* ]]> */</script>
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould<form action="<%= context + Prefix.DIFF_P + uriEncodedName %>">
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould<table class="src" id="revisions">
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould <caption>History log of <a href="<%= context + Prefix.XREF_P
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould + uriEncodedName %>"><%= path %></a></caption>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <th>Revision <%
d5ad05ac17abfd7d2eae333a8c1233971e1c1a8fAbhishek Sharma Public %><a href="#" onclick="javascript: toggle_revtags(); return false;">
d5ad05ac17abfd7d2eae333a8c1233971e1c1a8fAbhishek Sharma Public <span class="revtags-hidden">
3fa7c9044653435c086b5a985a08442bef9a41c4theAdib (<<< Hide revision tags)</span>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <span class="revtags">
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould (Show revision tags >>>)</span></a><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen <th><input type="submit" value=" Compare "/></th><%
4b1c2be41ce8c1a88502c1b1885ad1468646fbfftheadib <th>Date</th>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <th>Author</th>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <th>Comments <%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould %><a href="#" onclick="javascript: toggle_filelist(); return false;">
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib <span class="filelist-hidden">
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib (<<< Hide modified files)</span>
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib <span class="filelist">
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib (Show modified files >>>)</span></a><%
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib int count=0;
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib for (HistoryEntry entry : hist.getHistoryEntries()) {
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib String rev = entry.getRevision();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib if (rev == null || rev.length() == 0) {
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib String tags = entry.getTags();
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib if (tags != null) {
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib int colspan;
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib colspan = 4;
09ba3247163582bf2e30e17c4c154aa259ce038acilix colspan = 5;
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <tr class="revtags-hidden">
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <td colspan="<%= colspan %>" class="revtags">
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib <b>Revision tags:</b> <%= tags %>
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib </tr><tr style="display: none;"></tr><%
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib <td><%= rev %></td><%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould String rp = uriEncodedName;
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib <td><a name="<%= rev %>" href="<%=
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib context + Prefix.XREF_P + rp + "?r=" + Util.URIEncode(rev) %>"><%=
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib rev %></a></td>
3fa7c9044653435c086b5a985a08442bef9a41c4theAdib <input type="radio"<%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen if (count == 0 ) {
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %> disabled="disabled"<%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen } else if (count == 1) {
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %> checked="checked"<%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %> name="r1" value="<%= path %>@<%= rev%>"/>
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen <input type="radio"
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib if (count == 0) {
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib %> checked="checked"<%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould %> value="<%= path %>@<%= rev %>"/></td><%
861fa436e7a6d6ff3eaa889b2298e0b82a0b238ctheadib striked = true;
861fa436e7a6d6ff3eaa889b2298e0b82a0b238ctheadib <td><del><%= rev %></del></td>
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould Date date = entry.getDate();
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould if (date != null) {
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould %><%= df.format(date) %><%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould String author = entry.getAuthor();
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould if (author == null) {
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib %>(no author)<%
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould } else if (userPage != null && userPage.length() > 0) {
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gould String alink = Util.getEmail(author);
5c45c5153b0415f7573f69f4ee3e946b5872a8d1theadib %><a href="<%= userPage + Util.htmlize(alink) + userPageSuffix
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %>"><%= Util.htmlize(author)%></a><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %><%= author %><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen if (bugPage != null && bugPage.length() > 0) {
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen cout = bugPattern.matcher(cout).replaceAll("<a href=\""
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen + bugPage + "$1\">$1</a>");
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen if (reviewPage != null && reviewPage.length() > 0) {
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen cout = reviewPattern.matcher(cout).replaceAll("<a href=\""
4072e7310cc222d31afc3b4364e492b41de3d5c8Johan Engelen + reviewPage + "$1\">$1</a>");
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen %><%= cout %><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen Set<String> files = entry.getFiles();
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen if (files != null) {
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib %><span class="filelist-hidden"><br/><%
3d2b040efe01bad393a1b2505e59d6d0a7b117d2theAdib for (String ifile : files) {
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak String jfile = ifile;
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak if ("/".equals(path)) {
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak } else if (ifile.startsWith(path)
09ba3247163582bf2e30e17c4c154aa259ce038acilix if (rev == "") {
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak<a class="h" href="<%= context + Prefix.XREF_P + ifile %>"><%= jfile %></a><br/><%
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak<a class="h" href="<%= context + Prefix.XREF_P + ifile %>?r=<%= rev %>"><%= jfile %></a><br/><%
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak if (striked) {
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyak%><p><b>Note:</b> No associated file changes are available for
e9b6af083e34e2397a8ddbe9781920733d09d151Ted Gouldrevisions with strike-through numbers (eg. <del>1.45</del>)</p><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen<p class="rssbadge"><a href="<%=context + Prefix.RSS_P + uriEncodedName
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen%>" title="RSS XML Feed of latest changes"><span id="rssi"></span></a></p><%
f3462bff432feef773f99bab7d5ae208d077ddb1Johan Engelen/* ---------------------- history.jsp end --------------------- */
87a23fa19c86ba74549937cbdc0c8d661f1e4409buliabyakinclude file="foot.jspf"