[PATCH 1 of 1 default] hgweb: column / side-by-side diff functionality
wujek srujek
wujek.srujek at googlemail.com
Sun Jun 3 21:43:16 UTC 2012
# HG changeset patch
# User wujek srujek <wujek.srujek at googlemail.com>
# Date 1338755144 -7200
# Node ID 2975d6fb8ad6cc24c020ed8507d9bc1c39652703
# Parent 0a0cf3f26938ff7a084f2dcc9e59152ac6060e1e
hgweb: column / side-by-side diff functionality
Adds new web command to the core, ``filecoldiff`` (and an alias, ``coldiff``),
which enables colorful side-by-side diff, which for some might be much easier to
work with than the standard line diff output. The idea how to implement comes
from the SonicHq extension.
The web interface gets a new link to call the column diff functionality. It
comes in two flavors: short output (the default), where only subsets (blocks) of
the files' contents that were actually changed are returned, with 3 lines of
context; and long output, where the whole files are output. The latter will
result in much more output most of the time, especially where very few lines
were changed in big files. The output modes are configurable with the new
``web.fullcoldiff`` setting in hgrc (taking values according to the
``mercurial.util.parsebool`` function). This hgrc setting can be overridden by
adding ``fullcoldiff=<bool>`` to the request query string. The diff creates
addressable lines, so as to enable sending links to appropriate lines, just as
the standard diff does.
Known limitations:
* the column diff is done against the first parent, just as the standard diff
* this change allows examining diffs for single files only (as I am not sure if
examining the whole changeset in this way would be helpful)
* syntax highlighting of the output changes is not performed (enabling the
highlight extension has no influence on it)
* only the default (paper) style is updated, the rest will come next
* the number of context lines in short output is not configurable (I'm not sure
if this is necessary)
diff --git a/mercurial/help/config.txt b/mercurial/help/config.txt
--- a/mercurial/help/config.txt
+++ b/mercurial/help/config.txt
@@ -1377,6 +1377,11 @@
``errorlog``
Where to output the error log. Default is stderr.
+``fullcoldiff``
+ Whether column / side-by-side diff should output the files' full contents,
+ or just the changed blocks with context around them. Setting it to False
+ results in more concise output. Default is False.
+
``hidden``
Whether to hide the repository in the hgwebdir index.
Default is False.
diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py
--- a/mercurial/hgweb/webcommands.py
+++ b/mercurial/hgweb/webcommands.py
@@ -8,6 +8,7 @@
import os, mimetypes, re, cgi, copy
import webutil
from mercurial import error, encoding, archival, templater, templatefilters
+from mercurial import util
from mercurial.node import short, hex
from mercurial.util import binary
from common import paritygen, staticfile, get_contact, ErrorResponse
@@ -23,6 +24,7 @@
'log', 'rawfile', 'file', 'changelog', 'shortlog', 'changeset', 'rev',
'manifest', 'tags', 'bookmarks', 'branches', 'summary', 'filediff', 'diff',
'annotate', 'filelog', 'archive', 'static', 'graph', 'help',
+ 'filecoldiff', 'coldiff'
]
def log(web, req, tmpl):
@@ -586,6 +588,28 @@
diff = filediff
+def filecoldiff(web, req, tmpl):
+ fctx = webutil.filectx(web.repo, req)
+ rename = fctx and webutil.renamelink(fctx) or []
+ full = web.configbool('web', 'fullcoldiff', False)
+ if 'fullcoldiff' in req.form:
+ full = util.parsebool(req.form['fullcoldiff'][0])
+ coldiff = webutil.coldiff(tmpl, fctx, full)
+ return tmpl('filecoldiff',
+ file=fctx.path(),
+ node=hex(fctx.node()),
+ rev=fctx.rev(),
+ date=fctx.date(),
+ desc=fctx.description(),
+ author=fctx.user(),
+ rename=rename,
+ branch=webutil.nodebranchnodefault(fctx),
+ parent=webutil.parents(fctx),
+ child=webutil.children(fctx),
+ coldiff=coldiff)
+
+coldiff = filecoldiff
+
def annotate(web, req, tmpl):
fctx = webutil.filectx(web.repo, req)
f = fctx.path()
diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py
--- a/mercurial/hgweb/webutil.py
+++ b/mercurial/hgweb/webutil.py
@@ -6,10 +6,12 @@
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
-import os, copy
+import os, mimetypes, copy
from mercurial import match, patch, scmutil, error, ui, util
from mercurial.i18n import _
from mercurial.node import hex, nullid
+from mercurial.util import binary
+from difflib import SequenceMatcher
def up(p):
if p[0] != "/":
@@ -220,6 +222,106 @@
yield tmpl('diffblock', parity=parity.next(), blockno=blockno,
lines=prettyprintlines(''.join(block), blockno))
+def coldiff(tmpl, fctx, full):
+ '''Generator function that provides column / side-by-side diff data.'''
+
+ def filelines(f):
+ if binary(f.data()):
+ mt = mimetypes.guess_type(f.path())[0]
+ if not mt:
+ mt = 'application/octet-stream'
+ return [_('(binary file %s, hash: %s)') % (mt, hex(f.filenode()))]
+ return f.data().splitlines()
+
+ def diffline(type, leftlineno, leftline, rightlineno, rightline):
+ lineid = leftlineno and "l%s" % leftlineno or ''
+ lineid += rightlineno and "r%s" % rightlineno or ''
+ return tmpl('coldiffline',
+ type=type,
+ lineid=lineid,
+ leftlinenumber="% 6s" % (leftlineno or ''),
+ leftline=leftline or '',
+ rightlinenumber="% 6s" % (rightlineno or ''),
+ rightline=rightline or '')
+
+ def getblock(opcodes):
+ for type, llo, lhi, rlo, rhi in opcodes:
+ if type in ('equal'):
+ for i in xrange(lhi - llo):
+ yield diffline(type=type,
+ leftlineno=llo + i + 1,
+ leftline=leftlines[llo + i],
+ rightlineno=rlo + i + 1,
+ rightline=rightlines[rlo + i])
+ elif type == 'delete':
+ for i in xrange(llo, lhi):
+ yield diffline(type=type,
+ leftlineno=i + 1,
+ leftline=leftlines[i],
+ rightlineno=None,
+ rightline=None)
+ elif type == 'insert':
+ for i in xrange(rlo, rhi):
+ yield diffline(type=type,
+ leftlineno=None,
+ leftline=None,
+ rightlineno=i + 1,
+ rightline=rightlines[i])
+ else: # replace
+ len1 = lhi - llo
+ len2 = rhi - rlo
+ if len1 < len2:
+ count = len1
+ else:
+ count = len2
+ for i in xrange(count):
+ yield diffline(type=type,
+ leftlineno=llo + i + 1,
+ leftline=leftlines[llo + i],
+ rightlineno=rlo + i + 1,
+ rightline=rightlines[rlo + i])
+ if len1 > len2:
+ for i in xrange(llo + count, lhi):
+ yield diffline(type=type,
+ leftlineno=i + 1,
+ leftline=leftlines[i],
+ rightlineno=None,
+ rightline=None)
+ elif len2 > len1:
+ for i in xrange(rlo + count, rhi):
+ yield diffline(type=type,
+ leftlineno=None,
+ leftline=None,
+ rightlineno=i + 1,
+ rightline=rightlines[i])
+
+ parents = fctx.parents()
+ if not parents:
+ leftrev = -1
+ leftnode = nullid
+ leftlines = ()
+ else:
+ pfctx = parents[0]
+ leftrev = pfctx.filerev()
+ leftnode = pfctx.filenode()
+ leftlines = filelines(pfctx)
+
+ rightlines = filelines(fctx)
+
+ s = SequenceMatcher(None, leftlines, rightlines, False)
+ if full:
+ blocks = [tmpl('coldiffblock', lines=getblock(s.get_opcodes()))]
+ else:
+ blocks = (tmpl('coldiffblock', lines=getblock(oc))
+ for oc in s.get_grouped_opcodes())
+
+ yield tmpl('coldiff',
+ leftrev=leftrev,
+ leftnode=hex(leftnode),
+ rightrev=fctx.filerev(),
+ rightnode=hex(fctx.filenode()),
+ blocks=blocks)
+
def diffstatgen(ctx):
'''Generator function that provides the diffstat data.'''
diff --git a/mercurial/templates/paper/fileannotate.tmpl b/mercurial/templates/paper/fileannotate.tmpl
--- a/mercurial/templates/paper/fileannotate.tmpl
+++ b/mercurial/templates/paper/fileannotate.tmpl
@@ -25,6 +25,7 @@
<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url}coldiff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">col diff</a></li>
<li class="active">annotate</li>
<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
<li><a href="{url}raw-annotate/{node|short}/{file|urlescape}">raw</a></li>
diff --git a/mercurial/templates/paper/filediff.tmpl b/mercurial/templates/paper/filecoldiff.tmpl
copy from mercurial/templates/paper/filediff.tmpl
copy to mercurial/templates/paper/filecoldiff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filecoldiff.tmpl
@@ -23,7 +23,8 @@
<ul>
<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
-<li class="active">diff</li>
+<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li class="active">col diff</li>
<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
@@ -67,9 +68,16 @@
</table>
<div class="overflow">
-<div class="sourcefirst"> line diff</div>
+<div class="sourcefirst"> column diff</div>
+<div class="legend">
+ <span class="legendinfo equal">equal</span>
+ <span class="legendinfo delete">deleted</span>
+ <span class="legendinfo insert">inserted</span>
+ <span class="legendinfo replace">replaced</span>
+</div>
-{diff}
+{coldiff}
+
</div>
</div>
</div>
diff --git a/mercurial/templates/paper/filediff.tmpl b/mercurial/templates/paper/filediff.tmpl
--- a/mercurial/templates/paper/filediff.tmpl
+++ b/mercurial/templates/paper/filediff.tmpl
@@ -24,6 +24,7 @@
<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
<li class="active">diff</li>
+<li><a href="{url}coldiff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">col diff</a></li>
<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
diff --git a/mercurial/templates/paper/filelog.tmpl b/mercurial/templates/paper/filelog.tmpl
--- a/mercurial/templates/paper/filelog.tmpl
+++ b/mercurial/templates/paper/filelog.tmpl
@@ -27,6 +27,7 @@
<ul>
<li><a href="{url}file/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file</a></li>
<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url}coldiff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">col diff</a></li>
<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
<li class="active">file log</li>
<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
diff --git a/mercurial/templates/paper/filerevision.tmpl b/mercurial/templates/paper/filerevision.tmpl
--- a/mercurial/templates/paper/filerevision.tmpl
+++ b/mercurial/templates/paper/filerevision.tmpl
@@ -23,6 +23,7 @@
<li class="active">file</li>
<li><a href="{url}file/tip/{file|urlescape}{sessionvars%urlparameter}">latest</a></li>
<li><a href="{url}diff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">diff</a></li>
+<li><a href="{url}coldiff/{node|short}/{file|urlescape}{sessionvars%urlparameter}">col diff</a></li>
<li><a href="{url}annotate/{node|short}/{file|urlescape}{sessionvars%urlparameter}">annotate</a></li>
<li><a href="{url}log/{node|short}/{file|urlescape}{sessionvars%urlparameter}">file log</a></li>
<li><a href="{url}raw-file/{node|short}/{file|urlescape}">raw</a></li>
diff --git a/mercurial/templates/paper/map b/mercurial/templates/paper/map
--- a/mercurial/templates/paper/map
+++ b/mercurial/templates/paper/map
@@ -62,6 +62,7 @@
filerevision = filerevision.tmpl
fileannotate = fileannotate.tmpl
filediff = filediff.tmpl
+filecoldiff = filecoldiff.tmpl
filelog = filelog.tmpl
fileline = '
<div class="parity{parity} source"><a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}</div>'
@@ -82,6 +83,26 @@
difflineat = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> <span class="atline">{line|escape}</span>'
diffline = '<a href="#{lineid}" id="{lineid}">{linenumber}</a> {line|escape}'
+coldiff = '
+ <table class="bigtable">
+ <thead class="header">
+ <tr>
+ <th>{leftrev}:{leftnode|short}</th>
+ <th>{rightrev}:{rightnode|short}</th>
+ </tr>
+ </thead>
+ {blocks}
+ </table>'
+coldiffblock ='
+ <tbody class="block">
+ {lines}
+ </tbody>'
+coldiffline = '
+ <tr>
+ <td class="source {type}"><a href="#{lineid}" id="{lineid}">{leftlinenumber}</a> {leftline|escape}</td>
+ <td class="source {type}"><a href="#{lineid}" id="{lineid}">{rightlinenumber}</a> {rightline|escape}</td>
+ </tr>'
+
changelogparent = '
<tr>
<th class="parent">parent {rev}:</th>
diff --git a/mercurial/templates/static/style-paper.css b/mercurial/templates/static/style-paper.css
--- a/mercurial/templates/static/style-paper.css
+++ b/mercurial/templates/static/style-paper.css
@@ -275,3 +275,39 @@
position: relative;
top: -3px;
}
+
+/* Coldiff */
+.legend {
+ padding: 1.5% 0 1.5% 0;
+}
+
+.legendinfo {
+ border: 1px solid #999;
+ font-size: 80%;
+ text-align: center;
+ padding: 0.5%;
+}
+
+.equal {
+ background-color: #ffffff;
+}
+
+.delete {
+ background-color: #ffc5ce;
+}
+
+.insert {
+ background-color: #c5ffc4;
+}
+
+.replace {
+ background-color: #ffff99;
+}
+
+.header {
+ text-align: center;
+}
+
+.block {
+ border-top: 1px solid #999;
+}
diff --git a/tests/test-hgweb-commands.t b/tests/test-hgweb-commands.t
--- a/tests/test-hgweb-commands.t
+++ b/tests/test-hgweb-commands.t
@@ -605,6 +605,7 @@
<li class="active">file</li>
<li><a href="/file/tip/foo">latest</a></li>
<li><a href="/diff/a4f92ed23982/foo">diff</a></li>
+ <li><a href="/coldiff/a4f92ed23982/foo">col diff</a></li>
<li><a href="/annotate/a4f92ed23982/foo">annotate</a></li>
<li><a href="/log/a4f92ed23982/foo">file log</a></li>
<li><a href="/raw-file/a4f92ed23982/foo">raw</a></li>
diff --git a/tests/test-hgweb-diffs.t b/tests/test-hgweb-diffs.t
--- a/tests/test-hgweb-diffs.t
+++ b/tests/test-hgweb-diffs.t
@@ -214,6 +214,7 @@
<li><a href="/file/559edbd9ed20/b">file</a></li>
<li><a href="/file/tip/b">latest</a></li>
<li class="active">diff</li>
+ <li><a href="/coldiff/559edbd9ed20/b">col diff</a></li>
<li><a href="/annotate/559edbd9ed20/b">annotate</a></li>
<li><a href="/log/559edbd9ed20/b">file log</a></li>
<li><a href="/raw-file/559edbd9ed20/b">raw</a></li>
@@ -478,6 +479,7 @@
<li><a href="/file/559edbd9ed20/a">file</a></li>
<li><a href="/file/tip/a">latest</a></li>
<li class="active">diff</li>
+ <li><a href="/coldiff/559edbd9ed20/a">col diff</a></li>
<li><a href="/annotate/559edbd9ed20/a">annotate</a></li>
<li><a href="/log/559edbd9ed20/a">file log</a></li>
<li><a href="/raw-file/559edbd9ed20/a">raw</a></li>
@@ -536,6 +538,251 @@
</body>
</html>
+
+col diff new file
+
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/coldiff/0/a'
+ 200 Script output follows
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
+ <head>
+ <link rel="icon" href="/static/hgicon.png" type="image/png" />
+ <meta name="robots" content="index, nofollow" />
+ <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
+ <script type="text/javascript" src="/static/mercurial.js"></script>
+
+ <title>test: a diff</title>
+ </head>
+ <body>
+
+ <div class="container">
+ <div class="menu">
+ <div class="logo">
+ <a href="http://mercurial.selenic.com/">
+ <img src="/static/hglogo.png" alt="mercurial" /></a>
+ </div>
+ <ul>
+ <li><a href="/shortlog/0cd96de13884">log</a></li>
+ <li><a href="/graph/0cd96de13884">graph</a></li>
+ <li><a href="/tags">tags</a></li>
+ <li><a href="/bookmarks">bookmarks</a></li>
+ <li><a href="/branches">branches</a></li>
+ </ul>
+ <ul>
+ <li><a href="/rev/0cd96de13884">changeset</a></li>
+ <li><a href="/file/0cd96de13884">browse</a></li>
+ </ul>
+ <ul>
+ <li><a href="/file/0cd96de13884/a">file</a></li>
+ <li><a href="/file/tip/a">latest</a></li>
+ <li><a href="/diff/0cd96de13884/a">diff</a></li>
+ <li class="active">col diff</li>
+ <li><a href="/annotate/0cd96de13884/a">annotate</a></li>
+ <li><a href="/log/0cd96de13884/a">file log</a></li>
+ <li><a href="/raw-file/0cd96de13884/a">raw</a></li>
+ </ul>
+ <ul>
+ <li><a href="/help">help</a></li>
+ </ul>
+ </div>
+
+ <div class="main">
+ <h2><a href="/">test</a></h2>
+ <h3>diff a @ 0:0cd96de13884</h3>
+
+ <form class="search" action="/log">
+ <p></p>
+ <p><input name="rev" id="search1" type="text" size="30" /></p>
+ <div id="hint">find changesets by author, revision,
+ files, or words in the commit message</div>
+ </form>
+
+ <div class="description">a</div>
+
+ <table id="changesetEntry">
+ <tr>
+ <th>author</th>
+ <td>test</td>
+ </tr>
+ <tr>
+ <th>date</th>
+ <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
+ </tr>
+ <tr>
+ <th>parents</th>
+ <td></td>
+ </tr>
+ <tr>
+ <th>children</th>
+ <td></td>
+ </tr>
+
+ </table>
+
+ <div class="overflow">
+ <div class="sourcefirst"> column diff</div>
+ <div class="legend">
+ <span class="legendinfo equal">equal</span>
+ <span class="legendinfo delete">deleted</span>
+ <span class="legendinfo insert">inserted</span>
+ <span class="legendinfo replace">replaced</span>
+ </div>
+
+
+ <table class="bigtable">
+ <thead class="header">
+ <tr>
+ <th>-1:000000000000</th>
+ <th>0:b789fdd96dc2</th>
+ </tr>
+ </thead>
+
+ <tbody class="block">
+
+ <tr>
+ <td class="source insert"><a href="#r1" id="r1"> </a> </td>
+ <td class="source insert"><a href="#r1" id="r1"> 1</a> a</td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+ </div>
+ </div>
+
+ <script type="text/javascript">process_dates()</script>
+
+
+ </body>
+ </html>
+
+
+col diff existing file
+
+ $ echo a >> a
+ $ hg ci -mc
+ $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/coldiff/tip/a'
+ 200 Script output follows
+
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US">
+ <head>
+ <link rel="icon" href="/static/hgicon.png" type="image/png" />
+ <meta name="robots" content="index, nofollow" />
+ <link rel="stylesheet" href="/static/style-paper.css" type="text/css" />
+ <script type="text/javascript" src="/static/mercurial.js"></script>
+
+ <title>test: a diff</title>
+ </head>
+ <body>
+
+ <div class="container">
+ <div class="menu">
+ <div class="logo">
+ <a href="http://mercurial.selenic.com/">
+ <img src="/static/hglogo.png" alt="mercurial" /></a>
+ </div>
+ <ul>
+ <li><a href="/shortlog/d73db4d812ff">log</a></li>
+ <li><a href="/graph/d73db4d812ff">graph</a></li>
+ <li><a href="/tags">tags</a></li>
+ <li><a href="/bookmarks">bookmarks</a></li>
+ <li><a href="/branches">branches</a></li>
+ </ul>
+ <ul>
+ <li><a href="/rev/d73db4d812ff">changeset</a></li>
+ <li><a href="/file/d73db4d812ff">browse</a></li>
+ </ul>
+ <ul>
+ <li><a href="/file/d73db4d812ff/a">file</a></li>
+ <li><a href="/file/tip/a">latest</a></li>
+ <li><a href="/diff/d73db4d812ff/a">diff</a></li>
+ <li class="active">col diff</li>
+ <li><a href="/annotate/d73db4d812ff/a">annotate</a></li>
+ <li><a href="/log/d73db4d812ff/a">file log</a></li>
+ <li><a href="/raw-file/d73db4d812ff/a">raw</a></li>
+ </ul>
+ <ul>
+ <li><a href="/help">help</a></li>
+ </ul>
+ </div>
+
+ <div class="main">
+ <h2><a href="/">test</a></h2>
+ <h3>diff a @ 2:d73db4d812ff</h3>
+
+ <form class="search" action="/log">
+ <p></p>
+ <p><input name="rev" id="search1" type="text" size="30" /></p>
+ <div id="hint">find changesets by author, revision,
+ files, or words in the commit message</div>
+ </form>
+
+ <div class="description">c</div>
+
+ <table id="changesetEntry">
+ <tr>
+ <th>author</th>
+ <td>test</td>
+ </tr>
+ <tr>
+ <th>date</th>
+ <td class="date age">Thu, 01 Jan 1970 00:00:00 +0000</td>
+ </tr>
+ <tr>
+ <th>parents</th>
+ <td><a href="/file/0cd96de13884/a">0cd96de13884</a> </td>
+ </tr>
+ <tr>
+ <th>children</th>
+ <td></td>
+ </tr>
+
+ </table>
+
+ <div class="overflow">
+ <div class="sourcefirst"> column diff</div>
+ <div class="legend">
+ <span class="legendinfo equal">equal</span>
+ <span class="legendinfo delete">deleted</span>
+ <span class="legendinfo insert">inserted</span>
+ <span class="legendinfo replace">replaced</span>
+ </div>
+
+
+ <table class="bigtable">
+ <thead class="header">
+ <tr>
+ <th>0:b789fdd96dc2</th>
+ <th>1:a80d06849b33</th>
+ </tr>
+ </thead>
+
+ <tbody class="block">
+
+ <tr>
+ <td class="source equal"><a href="#l1r1" id="l1r1"> 1</a> a</td>
+ <td class="source equal"><a href="#l1r1" id="l1r1"> 1</a> a</td>
+ </tr>
+ <tr>
+ <td class="source insert"><a href="#r2" id="r2"> </a> </td>
+ <td class="source insert"><a href="#r2" id="r2"> 2</a> a</td>
+ </tr>
+ </tbody>
+ </table>
+
+ </div>
+ </div>
+ </div>
+
+ <script type="text/javascript">process_dates()</script>
+
+
+ </body>
+ </html>
+
+
$ cd ..
test import rev as raw-rev
diff --git a/tests/test-hgweb-filelog.t b/tests/test-hgweb-filelog.t
--- a/tests/test-hgweb-filelog.t
+++ b/tests/test-hgweb-filelog.t
@@ -148,6 +148,7 @@
<ul>
<li><a href="/file/01de2d66a28d/a">file</a></li>
<li><a href="/diff/01de2d66a28d/a">diff</a></li>
+ <li><a href="/coldiff/01de2d66a28d/a">col diff</a></li>
<li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
<li class="active">file log</li>
<li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
@@ -249,6 +250,7 @@
<ul>
<li><a href="/file/01de2d66a28d/a">file</a></li>
<li><a href="/diff/01de2d66a28d/a">diff</a></li>
+ <li><a href="/coldiff/01de2d66a28d/a">col diff</a></li>
<li><a href="/annotate/01de2d66a28d/a">annotate</a></li>
<li class="active">file log</li>
<li><a href="/raw-file/01de2d66a28d/a">raw</a></li>
@@ -350,6 +352,7 @@
<ul>
<li><a href="/file/5ed941583260/a">file</a></li>
<li><a href="/diff/5ed941583260/a">diff</a></li>
+ <li><a href="/coldiff/5ed941583260/a">col diff</a></li>
<li><a href="/annotate/5ed941583260/a">annotate</a></li>
<li class="active">file log</li>
<li><a href="/raw-file/5ed941583260/a">raw</a></li>
@@ -446,6 +449,7 @@
<ul>
<li><a href="/file/5ed941583260/a">file</a></li>
<li><a href="/diff/5ed941583260/a">diff</a></li>
+ <li><a href="/coldiff/5ed941583260/a">col diff</a></li>
<li><a href="/annotate/5ed941583260/a">annotate</a></li>
<li class="active">file log</li>
<li><a href="/raw-file/5ed941583260/a">raw</a></li>
diff --git a/tests/test-hgweb-removed.t b/tests/test-hgweb-removed.t
--- a/tests/test-hgweb-removed.t
+++ b/tests/test-hgweb-removed.t
@@ -171,6 +171,7 @@
<li><a href="/file/c78f6c5cbea9/a">file</a></li>
<li><a href="/file/tip/a">latest</a></li>
<li class="active">diff</li>
+ <li><a href="/coldiff/c78f6c5cbea9/a">col diff</a></li>
<li><a href="/annotate/c78f6c5cbea9/a">annotate</a></li>
<li><a href="/log/c78f6c5cbea9/a">file log</a></li>
<li><a href="/raw-file/c78f6c5cbea9/a">raw</a></li>
diff --git a/tests/test-highlight.t b/tests/test-highlight.t
--- a/tests/test-highlight.t
+++ b/tests/test-highlight.t
@@ -92,6 +92,7 @@
<li class="active">file</li>
<li><a href="/file/tip/primes.py">latest</a></li>
<li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
+ <li><a href="/coldiff/853dcd4de2a6/primes.py">col diff</a></li>
<li><a href="/annotate/853dcd4de2a6/primes.py">annotate</a></li>
<li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
<li><a href="/raw-file/853dcd4de2a6/primes.py">raw</a></li>
@@ -222,6 +223,7 @@
<li><a href="/file/853dcd4de2a6/primes.py">file</a></li>
<li><a href="/file/tip/primes.py">latest</a></li>
<li><a href="/diff/853dcd4de2a6/primes.py">diff</a></li>
+ <li><a href="/coldiff/853dcd4de2a6/primes.py">col diff</a></li>
<li class="active">annotate</li>
<li><a href="/log/853dcd4de2a6/primes.py">file log</a></li>
<li><a href="/raw-annotate/853dcd4de2a6/primes.py">raw</a></li>
More information about the Mercurial-devel
mailing list