diff.jsp revision d8371503c60e1f6933455e25b1cc47e4858a3a43
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<%--
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano$Id$
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoCDDL HEADER START
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoThe contents of this file are subject to the terms of the
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoCommon Development and Distribution License (the "License").
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoYou may not use this file except in compliance with the License.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoSee LICENSE.txt included in this distribution for the specific
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanolanguage governing permissions and limitations under the License.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoWhen distributing Covered Code, include this CDDL HEADER in each
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanofile and include the License file at LICENSE.txt.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoIf applicable, add the following below this CDDL HEADER, with the
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanofields enclosed by brackets "[]" replaced with your own identifying
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoinformation: Portions Copyright [yyyy] [name of copyright owner]
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoCDDL HEADER END
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoCopyright 2009 Sun Microsystems, Inc. All rights reserved.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoUse is subject to license terms.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoPortions Copyright 2011 Jens Elkner.
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano--%><%@page import="
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normandjava.io.BufferedReader,
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normandjava.io.FileNotFoundException,
10fba81b9d0221b8e47aa1e0b43236413b7d28dfMichel Normandjava.io.InputStream,
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normandjava.io.InputStreamReader,
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normandjava.io.UnsupportedEncodingException,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanojava.net.URLDecoder,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanojava.util.ArrayList,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.apache.commons.jrcs.diff.Chunk,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.apache.commons.jrcs.diff.Delta,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.apache.commons.jrcs.diff.Diff,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.apache.commons.jrcs.diff.Revision,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.opensolaris.opengrok.analysis.AnalyzerGuru,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.opensolaris.opengrok.analysis.FileAnalyzer.Genre,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.opensolaris.opengrok.web.DiffData,
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoorg.opensolaris.opengrok.web.DiffType"
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%><%!
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcanoprivate String getAnnotateRevision(DiffData data) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (data.type == DiffType.OLD || data.type == DiffType.NEW) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano return "<script type=\"text/javascript\">/* <![CDATA[ */ "
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano + "document.rev = 'r=" + data.rev[data.type == DiffType.NEW ? 1 : 0]
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano + "'; /* ]]> */</script>";
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano return "";
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano}
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%><%@
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normandinclude file="mast.jsp"
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano/* ---------------------- diff.jsp start --------------------- */
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano{
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano cfg = PageConfig.get(request);
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano DiffData data = cfg.getDiffData();
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (data.errorMsg != null) {
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano%>
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano<div class="src">
6a22713f648be8bd21297f57d9b631eb4c537ffeDaniel Lezcano <h3 class="error">Error:</h3>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <p><%= data.errorMsg %></p>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano</div><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else if (data.genre == Genre.IMAGE) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String link = request.getContextPath() + Prefix.DOWNLOAD_P
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano + Util.htmlize(cfg.getPath());
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<div id="difftable">
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <table class="image">
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <thead>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <tr><th><%= data.filename %> (revision <%= data.rev[0] %>)</th>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <th><%= data.filename %> (revision <%= data.rev[1] %>)</th>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </tr>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </thead>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <tbody>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <tr><td><img src="<%= link %>?r=<%= data.rev[0] %>"/></td>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <td><img src="<%= link %>?r=<%= data.rev[1] %>"/></td>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </tr>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </tbody>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </table>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano</div><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else if (data.genre != Genre.PLAIN && data.genre != Genre.HTML) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String link = request.getContextPath() + Prefix.DOWNLOAD_P
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano + Util.htmlize(cfg.getPath());
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<div id="src">Diffs for binary files cannot be displayed! Files are <a
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano href="<%= link %>?r=<%= data.rev[0] %>"><%=
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano data.filename %>(revision <%= data.rev[0] %>)</a> and <a
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand href="<%= link %>?r=<%= data.rev[1] %>"><%=
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand data.filename %>(revision <%= data.rev[1] %>)</a>.
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand</div><%
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand } else if (data.revision.size() == 0) {
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand %>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <%= getAnnotateRevision(data) %>
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand <b>No differences found!</b><%
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand } else {
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand //-------- Do THE DIFFS ------------
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand int ln1 = 0;
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand int ln2 = 0;
0bb4f8cf3b3b984dc150a11cb2e4d83ba4c49970Michel Normand String rp1 = data.param[0];
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String rp2 = data.param[1];
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String reqURI = request.getRequestURI();
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String[] file1 = data.file[0];
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano String[] file2 = data.file[1];
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano DiffType type = data.type;
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano boolean full = data.full;
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano%>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<%= getAnnotateRevision(data) %>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano<div id="diffbar">
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <div class="legend">
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span class="d">Deleted</span>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span class="a">Added</span>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano </div>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <div class="tabs"><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano for (DiffType t : DiffType.values()) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (type == t) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> <span class="active"><%= t.toString() %><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (t == DiffType.OLD) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> ( <%= data.rev[0] %> )<%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else if (t == DiffType.NEW) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> ( <%= data.rev[1] %> )<%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %></span><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> <span><a href="<%= reqURI %>?r1=<%= rp1 %>&amp;r2=<%= rp2
99e4008cad9e959b683c6f48411fcf15a92be3b5Michel Normand %>&amp;format=<%= t.getAbbrev() %>&amp;full=<%= full ? '1' : '0'
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %>"><%= t.toString() %><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (t == DiffType.OLD) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> ( <%= data.rev[0] %> )<%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else if (t == DiffType.NEW) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %> ( <%= data.rev[1] %> )<%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %></a></span><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %></div>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <div class="ctype"><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano if (!full) {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span><a href="<%= reqURI %>?r1=<%= rp1 %>&amp;r2=<%= rp2
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %>&amp;format=<%= type.getAbbrev() %>&amp;full=1">full</a></span>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span class="active">compact</span><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano } else {
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span class="active">full</span>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano <span> <a href="<%= reqURI %>?r1=<%= rp1 %>&amp;r2=<%= rp2
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %>&amp;format=<%= type.getAbbrev() %>&amp;full=0">compact</a></span><%
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano }
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano %></div>
d823d5b966f49d975a09a8512d084389d6d7ffc7dlezcano</div>
<div id="difftable">
<div class="pre"><%
if (type == DiffType.SIDEBYSIDE || type == DiffType.UNIFIED) {
%><table class="plain"><%
if (type == DiffType.SIDEBYSIDE) {
%>
<thead><tr>
<th><%= data.filename %> (<%= data.rev[0] %>)</th>
<th><%= data.filename %> (<%= data.rev[1] %>)</th>
</tr></thead><%
}
%>
<tbody><%
}
for (int i=0; i < data.revision.size(); i++) {
Delta d = data.revision.getDelta(i);
if (type == DiffType.TEXT) {
%><%= Util.htmlize(d.toString()) %><%
} else {
Chunk c1 = d.getOriginal();
Chunk c2 = d.getRevised();
int cn1 = c1.first();
int cl1 = c1.last();
int cn2 = c2.first();
int cl2 = c2.last();
int i1 = cn1, i2 = cn2;
StringBuilder bl1 = new StringBuilder(80);
StringBuilder bl2 = new StringBuilder(80);
for (; i1 <= cl1 && i2 <= cl2; i1++, i2++) {
Util.htmlize(file1[i1], bl1);
Util.htmlize(file2[i2], bl2);
String[] ss = Util.diffline(bl1, bl2);
file1[i1] = ss[0];
file2[i2] = ss[1];
bl1.setLength(0);
bl2.setLength(0);
}
// deleted
for (; i1 <= cl1; i1++) {
bl1.setLength(0);
bl1.append("<span class=\"d\">");
Util.htmlize(file1[i1], bl1);
file1[i1] = bl1.append("</span>").toString();
}
// added
for (; i2 <= cl2; i2++) {
bl2.setLength(0);
bl2.append("<span class=\"a\">");
Util.htmlize(file2[i2], bl2);
file2[i2] = bl2.append("</span>").toString();
}
if (type == DiffType.UNIFIED) {
// UDIFF
if (cn1 > ln1 || cn2 > ln2) {
%>
<tr class="k"><td><%
if (full || (cn2 - ln2 < 20)) {
for (int j = ln2; j < cn2; j++) {
%><i><%= ++ln2 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
} else {
for (int j = ln2; j < ln2 + 8; j++) {
%><i><%= j+1 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
%><br/>--- <b><%= cn2 - ln2 - 16
%> unchanged lines hidden</b> (<a href="<%= reqURI
%>?r1=<%= rp1 %>&amp;r2=<%= rp2
%>&amp;format=<%= type.getAbbrev()
%>&amp;full=1#<%= ln2 %>">view full</a>) --- <br/><br/><%
ln2 = cn2 - 8;
for (int j = ln2; j < cn2; j++) {
%><i><%= ++ln2 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
}
%></td>
</tr><%
ln1 = cn1;
}
if (cn1 <= cl1) {
%>
<tr><td><%
for (int j = cn1; j <= cl1 ; j++) {
%><del class="d"><%= ++ln1 %></del><%= file1[j]
%><br/><%
}
%></td>
</tr><%
}
if (cn2 <= cl2) {
%>
<tr class="k"><td><%
for (int j = cn2; j < cl2; j++) {
%><i class="a"><%= ++ln2 %></i><%= file2[j]
%><br/><%
}
%><i class="a"><%= ++ln2 %></i><%= file2[cl2] %><%
if(full) {
%><a name="<%= ln2 %>" /><%
}
%></td>
</tr><%
}
} else if (type == DiffType.SIDEBYSIDE) {
// SDIFF
if (cn1 > ln1 || cn2 > ln2) {
%>
<tr class="k"><td><%
if (full || cn2 - ln2 < 20) {
for (int j = ln1; j < cn1; j++) {
%><i><%= ++ln1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
%></td><td><%
for (int j = ln2; j < cn2 ; j++) {
%><i><%= ++ln2 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
} else {
for (int j = ln1; j < ln1 + 8; j++) {
%><i><%= j+1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
%><br/>--- <b><%= cn1 - ln1 - 16
%> unchanged lines hidden</b> (<a href="<%= reqURI
%>?r1=<%= rp1 %>&amp;r2=<%= rp2
%>&amp;format=<%= type.getAbbrev()
%>&amp;full=1#<%= ln2 %>">view full</a>) --- <br/><br/><%
ln1 = cn1 - 8;
for (int j = ln1; j < cn1; j++) {
%><i><%= ++ln1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
%></td><td><%
for (int j = ln2; j < ln2 + 8; j++) {
%><i><%= j+1 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
%><br/>--- <b><%= cn2 - ln2 - 16
%> unchanged lines hidden</b> (<a href="<%= reqURI
%>?r1=<%= rp1 %>&amp;r2=<%= rp2
%>&amp;format=<%= type.getAbbrev()
%>&amp;full=1#<%= ln2 %>">view full</a>) --- <br/><br/><%
ln2 = cn2 - 8;
for (int j = ln2; j < cn2; j++) {
%><i><%= ++ln2 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
}
%></td>
</tr><%
}
%>
<tr class="k"><td><%
for (int j = cn1; j <= cl1; j++) {
%><i><%= ++ln1 %></i><%= file1[j] %><br/><%
}
%></td><td><%
for (int j = cn2; j <= cl2; j++) {
%><i><%= ++ln2 %></i><a name="<%= ln2 %>"></a><%=
file2[j] %><br/><%
}
%></td>
</tr><%
// OLD
} else if (type == DiffType.OLD) {
// OLD
if (cn1 > ln1) {
if (full || cn1 - ln1 < 20) {
for (int j = ln1; j < cn1; j++) {
%><i><%= ++ln1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
} else {
for (int j = ln1; j < ln1 + 8; j++) {
%><i><%= j+1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
%><br/>--- <b><%= cn1 - ln1 - 16
%> unchanged lines hidden</b> (<a href="<%= reqURI
%>?r1=<%= rp1 %>&amp;r2=<%= rp2
%>&amp;format=<%= type.getAbbrev()
%>&amp;full=1#<%=ln1%>">view full</a>) --- <br/><br/><%
ln1 = cn1 - 8;
for (int j = ln1; j < cn1; j++) {
%><i><%= ++ln1 %></i><%=
Util.htmlize(file1[j]) %><br/><%
}
}
}
for (int j = cn1; j <= cl1 ; j++) {
%><i><%= ++ln1 %></i><%= file1[j] %><br/><%
}
if (full) {
%><a name="<%=ln1%>" ></a><%
}
// NEW
} else if (type == DiffType.NEW) {
if (cn2 > ln2) {
if (full || cn2 - ln2 < 20) {
for (int j = ln2; j < cn2 ; j++) {
%><i><%= ++ln2 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
} else {
for (int j = ln2; j < ln2 + 8; j++) {
%><i><%= j+1 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
%><br/>--- <b><%= cn2 - ln2 - 16
%> unchanged lines hidden</b> (<a href="<%= reqURI
%>?r1=<%= rp1 %>&amp;r2=<%= rp2
%>&amp;format=<%= type.getAbbrev()
%>&amp;full=1#<%= ln2 %>">view full</a>) --- <br/><br/><%
ln2 = cn2 - 8;
for (int j = ln2; j < cn2; j++) {
%><i><%= ++ln2 %></i><%=
Util.htmlize(file2[j]) %><br/><%
}
}
}
for (int j = cn2; j <= cl2 ; j++) {
%><i><%= ++ln2 %></i><%= file2[j] %><br/><%
}
if (full) {
%><a name="<%= ln2 %>"></a><%
}
}
} // else
} // for
// deltas done, dump the remaining
if (file1.length >= ln1) {
if (type == DiffType.SIDEBYSIDE) {
if (full || file1.length - ln1 < 20) {
%>
<tr><td><%
for (int j = ln1; j < file1.length ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
}
%></td><td><%
for (int j = ln2; j < file2.length ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
%></td>
</tr>
</tbody>
</table><%
} else {
%>
<tr><td><%
for (int j = ln1; j < ln1 + 8 ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
}
%><br/> --- <b><%= file1.length - ln1 - 8
%> unchanged lines hidden</b> --- </td><td><%
for (int j = ln2; j < ln2 + 8 ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
%><br/>--- <b><%= file1.length - ln1 - 8
%> unchanged lines hidden</b> ---</td>
</tr>
</tbody>
</table><%
}
} else if (type == DiffType.UNIFIED) {
if (full || file2.length - ln2 < 20) {
%>
<tr><td><%
for (int j = ln2; j < file2.length ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
%></td>
</tr>
</tbody>
</table><%
} else {
%>
<tr><td><%
for (int j = ln2; j < ln2 + 8 ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
%><br/>--- <b><%= file2.length - ln2 - 8
%> unchanged lines hidden</b> ---</td>
</tr>
</tbody>
</table><%
}
} else if (type == DiffType.OLD) {
if (full || file1.length - ln1 < 20) {
for (int j = ln1; j < file1.length ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
}
} else {
for (int j = ln1; j < ln1 + 8 ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file1[j]) %><br/><%
}
%><br/> --- <b><%= file1.length - ln1 - 8
%> unchanged lines hidden</b> ---<br/><%
}
} else if (type == DiffType.NEW) {
if (full || file2.length - ln2 < 20) {
for (int j = ln2; j < file2.length ; j++) {
%><i><%= j+1 %></i><%=Util.htmlize(file2[j])%><br/><%
}
} else {
for (int j = ln2; j < ln2 + 8 ; j++) {
%><i><%= j+1 %></i><%= Util.htmlize(file2[j]) %><br/><%
}
%><br/> --- <b><%= file2.length - ln2 - 8
%> unchanged lines hidden</b> ---<br/><%
}
}
}
//----DIFFS Done--------
%></div>
</div><%
}
}
/* ---------------------- diff.jsp end --------------------- */
%><%@
include file="foot.jspf"
%>