diff.jsp revision 1025
431N/ASee LICENSE.txt included in this distribution for the specific
431N/Afile and include the License file at LICENSE.txt.
431N/A--%><%@ page import = "javax.servlet.*,
431N/A return String.valueOf(n);
431N/A final String rp1 = request.getParameter("r1");
431N/A final String rp2 = request.getParameter("r2");
431N/A String srcRoot = environment.getSourceRootFile().getAbsolutePath();
431N/A if (tmp != null && tmp.length == 2) {
431N/A rpath1 = new File(srcRoot+URLDecoder.decode(tmp[0], "UTF-8"));
431N/A r1 = URLDecoder.decode(tmp[1], "UTF-8");
431N/A if (tmp != null && tmp.length == 2) {
431N/A if (tmp != null && tmp.length == 2) {
431N/A rpath2 = new File(srcRoot+URLDecoder.decode(tmp[0], "UTF-8"));
431N/A r2 = URLDecoder.decode(tmp[1], "UTF-8");
431N/A Please pick two revisions to compare the changed from the <a href="<%=context%>/history<%=path%>">history</a>
565N/A Genre g = AnalyzerGuru.getGenre(basename);
431N/A g = AnalyzerGuru.getGenre(basename);
431N/A g = AnalyzerGuru.getGenre(in1);
431N/A if (g == Genre.IMAGE) {
431N/A <table rules="cols" cellpadding="5"><tr><th><%=basename%> (revision <%=r1%>)</th><th><%=basename%> (revision <%=r2%>)</th></tr>
526N/A <tr><td><img src="<%=context%>/raw<%=path%>?r=<%=r1%>"/></td><td><img src="<%=context%>/raw<%=path%>?r=<%=r2%>"/></td></tr></table></div><%
526N/A while ((line = reader1.readLine()) != null) {
526N/A while ((line = reader2.readLine()) != null) {
431N/A Object[] file1 = l1.toArray();
431N/A Object[] file2 = l2.toArray();
431N/A String format = request.getParameter("format");
431N/A if(format == null || (!format.equals("o") && !format.equals("n") && !format.equals("u") && !format.equals("t")))
431N/A String pfull = request.getParameter("full");
431N/A boolean full = pfull != null && pfull.equals("1");
431N/A%><div id="difftable"><div id="diffbar"><span class="tabsel"> <span class="d"> Deleted </span> <span class="a"> Added </span> </span> | <%
431N/Aif(format.equals("s")) {
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=s&full=<%=pfull%>">sdiff</a></span> <%
431N/A if(format.equals("u")) {
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=u&full=<%=pfull%>">udiff</a></span> <%
431N/A if(format.equals("t")) {
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=t&full=<%=pfull%>">text</a></span> <%
431N/A if(format.equals("o")) {
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=o&full=<%=pfull%>">old (<%=r1%>)</a></span> <%
431N/A if(format.equals("n")) {
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=n&full=<%=pfull%>">new (<%=r2%>)</a></span> | <%
431N/A %><span class="tab"><a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1"> full </a></span> <span class="tabsel"><b>compact</b></span><%
431N/A %><span class="tabsel"><b> full </b> </span> <span class="tab"> <a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=0">compact</a></span><%
431N/A if(format.equals("s")) {
431N/A Delta d = rev.getDelta(i);
431N/A if(format.equals("t")) {
431N/A Chunk c1 = d.getOriginal();
431N/A Chunk c2 = d.getRevised();
431N/A String[] ss = Util.diffline(Util.htmlize((String)file1[i1]), Util.htmlize((String)file2[i2]));
431N/A file1[h] = Util.htmlize((String)file1[h]);
431N/A file2[h] = Util.htmlize((String)file2[h]);
431N/A if (format.equals("u")) {
431N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A %><i><%=readableLine(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A %><br/>--- <b><%=cn2 - ln2 - 16%> unchanged lines hidden</b> (<a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1#<%=ln2%>">view full</a>) --- <br/><br/><%
431N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A } else if(format.equals("s")) {
431N/A %><i><%=readableLine(++ln1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
431N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A %><i><%=readableLine(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
431N/A %><br/>--- <b><%=cn1 - ln1 - 16%> unchanged lines hidden</b> (<a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1#<%=ln2%>">view full</a>) --- <br/><br/><%
431N/A %><i><%=readableLine(++ln1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
431N/A %><i><%=readableLine(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A %><br/>--- <b><%=cn2 - ln2 - 16%> unchanged lines hidden</b> (<a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1#<%=ln2%>">view full</a>) --- <br/><br/><%
431N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
431N/A } else if ( format.equals("o")) {
431N/A %><i><%=readableLine(++ln1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
431N/A %><i><%=readableLine(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
471N/A %><br/>--- <b><%=cn1 - ln1 - 16%> unchanged lines hidden</b> (<a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1#<%=ln1%>">view full</a>) --- <br/><br/><%
480N/A %><i><%=readableLine(++ln1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
471N/A } else if ( format.equals("n")) {
471N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
490N/A %><i><%=readableLine(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
490N/A %><br/>--- <b><%=cn2 - ln2 - 16%> unchanged lines hidden</b> (<a href="<%=reqURI%>?r1=<%=rp1%>&r2=<%=rp2%>&format=<%=format%>&full=1#<%=ln2%>">view full</a>) --- <br/><br/><%
490N/A %><i><%=readableLine(++ln2)%></i><%=Util.htmlize((String)file2[j])%><br/><%
492N/A if (file1.length >= ln1) {
490N/A if (format.equals("s")) {
if (full || file1.length - ln1 < 20) {
for (int j = ln1; j < file1.length ; j++) {
%><i><%=(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
for (int j = ln2; j < file2.length ; j++) {
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><i><%=(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
%><br/> --- <b><%=file1.length - ln1 - 8%> unchanged lines hidden</b> --- </td><td><%
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><br/>--- <b><%=file1.length - ln1 - 8%> unchanged lines hidden</b> ---</td></tr></table><%
} else if (format.equals("u")) {
if (full || file2.length - ln2 < 20) {
for (int j = ln2; j < file2.length ; j++) {
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><br/>--- <b><%=file2.length - ln2 - 8%> unchanged lines hidden</b> ---</td></tr></table><%
} else if (format.equals("o")) {
if (full || file1.length - ln1 < 20) {
for (int j = ln1; j < file1.length ; j++) {
%><i><%=(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
%><i><%=(j+1)%></i><%=Util.htmlize((String)file1[j])%><br/><%
%><br/> --- <b><%=file1.length - ln1 - 8%> unchanged lines hidden</b> ---<br/><%
} else if (format.equals("n")) {
if (full || file2.length - ln2 < 20) {
for (int j = ln2; j < file2.length ; j++) {
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><i><%=(j+1)%></i><%=Util.htmlize((String)file2[j])%><br/><%
%><br/> --- <b><%=file2.length - ln2 - 8%> unchanged lines hidden</b> ---<br/><%
%> <div id="src">Diffs for binary files cannot be displayed! Files are <a href="<%=context%>/raw<%=path%>?r=<%=r1%>"><%=basename%>(revision <%=r1%>)</a> and
%><div class="src"><h3 class="error">Error Opening files! <%=Util.htmlize(e.getMessage())%></h3></div><%
in1.close();
in2.close();
} else if (g == Genre.IMAGE) {
<table rules="cols" cellpadding="5"><tr><th><%=basename%> (revision <%=r1%>)</th><th><%=basename%> (revision <%=r2%>)</th></tr>
<tr><td><img src="<%=context%>/raw<%=path%>?r=<%=r1%>"/></td><td><img src="<%=context%>/raw<%=path%>?r=<%=r2%>"/></td></tr></table></div><%
%> <div class="src">Diffs for binary files cannot be displayed. Files are <a href="<%=context%>/raw<%=path%>?r=<%=r1%>"><%=basename%>(revision <%=r1%>)</a> and
%><%@include file="foot.jspf"%><%