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