# HG changeset patch # User wujek srujek # Date 1341760622 -7200 # Node ID 1ae119269ddcbf818217a37608518b27a26ae4e2 # Parent afd75476939e0a229816e6683607fbe5ab222c11 hgweb: side-by-side comparison functionality Adds new web command to the core, ``comparison``, which enables colorful side-by-side change display, 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 comparison functionality. It lets users configure the amount of context lines around change blocks, or to show full files - check help (also in this changeset) for details and defaults. The setting in hgrc can be overridden by adding ``context=`` to the request query string. The comparison creates addressable lines, so as to enable sharing links to specific lines, just as standard diff does. Incorporates updates to all web related styles. 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) diff -r afd75476939e -r 1ae119269ddc mercurial/help/config.txt --- a/mercurial/help/config.txt Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/help/config.txt Sun Jul 08 17:17:02 2012 +0200 @@ -1377,6 +1377,12 @@ ``errorlog`` Where to output the error log. Default is stderr. +``comparisoncontext`` + Number of lines of context to show in side-by-side file comparison. If + negative or the value ``full``, whole files are shown. Default is 5. + This setting can be overridden by a ``context`` request parameter to the + ``comparison`` command, taking the same values. + ``hidden`` Whether to hide the repository in the hgwebdir index. Default is False. diff -r afd75476939e -r 1ae119269ddc mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/hgweb/webcommands.py Sun Jul 08 17:17:02 2012 +0200 @@ -22,7 +22,7 @@ __all__ = [ 'log', 'rawfile', 'file', 'changelog', 'shortlog', 'changeset', 'rev', 'manifest', 'tags', 'bookmarks', 'branches', 'summary', 'filediff', 'diff', - 'annotate', 'filelog', 'archive', 'static', 'graph', 'help', + 'comparison', 'annotate', 'filelog', 'archive', 'static', 'graph', 'help', ] def log(web, req, tmpl): @@ -586,6 +586,31 @@ diff = filediff +def comparison(web, req, tmpl): + ctx = webutil.changectx(web.repo, req) + path = webutil.cleanpath(web.repo, req.form['file'][0]) + rename = path in ctx and webutil.renamelink(ctx[path]) or [] + + parsecontext = lambda v: v == 'full' and -1 or int(v) + if 'context' in req.form: + context = parsecontext(req.form['context'][0]) + else: + context = parsecontext(web.config('web', 'comparisoncontext', '5')) + + comparison = webutil.compare(tmpl, ctx, path, context) + return tmpl('filecomparison', + file=path, + node=hex(ctx.node()), + rev=ctx.rev(), + date=ctx.date(), + desc=ctx.description(), + author=ctx.user(), + rename=rename, + branch=webutil.nodebranchnodefault(ctx), + parent=webutil.parents(ctx), + child=webutil.children(ctx), + comparison=comparison) + def annotate(web, req, tmpl): fctx = webutil.filectx(web.repo, req) f = fctx.path() diff -r afd75476939e -r 1ae119269ddc mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/hgweb/webutil.py Sun Jul 08 17:17:02 2012 +0200 @@ -6,10 +6,11 @@ # 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 +import difflib def up(p): if p[0] != "/": @@ -220,6 +221,92 @@ yield tmpl('diffblock', parity=parity.next(), blockno=blockno, lines=prettyprintlines(''.join(block), blockno)) +def compare(tmpl, ctx, path, context): + '''Generator function that provides side-by-side comparison data.''' + + def filelines(f): + if util.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 compline(type, leftlineno, leftline, rightlineno, rightline): + lineid = leftlineno and ("l%s" % leftlineno) or '' + lineid += rightlineno and ("r%s" % rightlineno) or '' + return tmpl('comparisonline', + 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: + len1 = lhi - llo + len2 = rhi - rlo + count = min(len1, len2) + for i in xrange(count): + yield compline(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 compline(type=type, + leftlineno=i + 1, + leftline=leftlines[i], + rightlineno=None, + rightline=None) + elif len2 > len1: + for i in xrange(rlo + count, rhi): + yield compline(type=type, + leftlineno=None, + leftline=None, + rightlineno=i + 1, + rightline=rightlines[i]) + + if path in ctx: + fctx = ctx[path] + rightrev = fctx.filerev() + rightnode = fctx.filenode() + rightlines = filelines(fctx) + parents = fctx.parents() + if not parents: + leftrev = -1 + leftnode = nullid + leftlines = () + else: + pfctx = parents[0] + leftrev = pfctx.filerev() + leftnode = pfctx.filenode() + leftlines = filelines(pfctx) + else: + rightrev = -1 + rightnode = nullid + rightlines = () + fctx = ctx.parents()[0][path] + leftrev = fctx.filerev() + leftnode = fctx.filenode() + leftlines = filelines(fctx) + + s = difflib.SequenceMatcher(None, leftlines, rightlines) + if context < 0: + blocks = [tmpl('comparisonblock', lines=getblock(s.get_opcodes()))] + else: + blocks = (tmpl('comparisonblock', lines=getblock(oc)) + for oc in s.get_grouped_opcodes(n=context)) + + yield tmpl('comparison', + leftrev=leftrev, + leftnode=hex(leftnode), + rightrev=rightrev, + rightnode=hex(rightnode), + blocks=blocks) + def diffstatgen(ctx): '''Generator function that provides the diffstat data.''' diff -r afd75476939e -r 1ae119269ddc mercurial/templates/coal/map --- a/mercurial/templates/coal/map Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/coal/map Sun Jul 08 17:17:02 2012 +0200 @@ -63,6 +63,7 @@ filerevision = ../paper/filerevision.tmpl fileannotate = ../paper/fileannotate.tmpl filediff = ../paper/filediff.tmpl +filecomparison = ../paper/filecomparison.tmpl filelog = ../paper/filelog.tmpl fileline = '
{linenumber} {line|escape}
' @@ -83,6 +84,26 @@ difflineat = '{linenumber} {line|escape}' diffline = '{linenumber} {line|escape}' +comparison = ' + + + + + + + + {blocks} +
{leftrev}:{leftnode|short}{rightrev}:{rightnode|short}
' +comparisonblock =' + + {lines} + ' +comparisonline = ' + + {leftlinenumber} {leftline|escape} + {rightlinenumber} {rightline|escape} + ' + changelogparent = ' parent {rev}: diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/fileannotate.tmpl --- a/mercurial/templates/gitweb/fileannotate.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/gitweb/fileannotate.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -26,6 +26,7 @@ revisions | annotate | diff | +comparison | raw | help
diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/filecomparison.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial/templates/gitweb/filecomparison.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -0,0 +1,63 @@ +{header} +{repo|escape}: comparison {file|escape} + + + + + + + + + +
{file|escape}
+ + +{branch%filerevbranch} + + + +{parent%filecompparent} +{child%filecompchild} +
changeset {rev}{node|short}
+ +
+ +
+ +
+ equal + deleted + inserted + replaced +
+ +
+{comparison} +
+ +
+ +{footer} diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/filediff.tmpl --- a/mercurial/templates/gitweb/filediff.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/gitweb/filediff.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -26,6 +26,7 @@ revisions | annotate | diff | +comparison | raw | help
diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/filelog.tmpl --- a/mercurial/templates/gitweb/filelog.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/gitweb/filelog.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -23,6 +23,7 @@ revisions | annotate | diff | +comparison | rss | help
diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/filerevision.tmpl --- a/mercurial/templates/gitweb/filerevision.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/gitweb/filerevision.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -26,6 +26,7 @@ revisions | annotate | diff | +comparison | raw | help
diff -r afd75476939e -r 1ae119269ddc mercurial/templates/gitweb/map --- a/mercurial/templates/gitweb/map Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/gitweb/map Sun Jul 08 17:17:02 2012 +0200 @@ -26,6 +26,7 @@ file | annotate | diff | + comparison | revisions ' @@ -37,6 +38,7 @@ file | annotate | diff | + comparison | revisions ' @@ -81,6 +83,7 @@ filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl filediff = filediff.tmpl +filecomparison = filecomparison.tmpl filelog = filelog.tmpl fileline = '
@@ -99,6 +102,27 @@ difflineminus = '{linenumber} {line|escape}' difflineat = '{linenumber} {line|escape}' diffline = '{linenumber} {line|escape}' + +comparison = ' + + + + + + + + {blocks} +
{leftrev}:{leftnode|short}{rightrev}:{rightnode|short}
' +comparisonblock =' + + {lines} + ' +comparisonline = ' + +
{leftlinenumber} {leftline|escape}
+
{rightlinenumber} {rightline|escape}
+ ' + changelogparent = ' parent {rev}: @@ -203,6 +227,15 @@ ' +filecompparent = ' + + parent {rev} + + + {node|short} + + + ' filelogparent = ' parent {rev}:  @@ -215,6 +248,13 @@ {node|short} ' +filecompchild = ' + + child {rev} + + {node|short} + + ' filelogchild = ' child {rev}:  diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/fileannotate.tmpl --- a/mercurial/templates/monoblue/fileannotate.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/monoblue/fileannotate.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -35,6 +35,7 @@
  • revisions
  • annotate
  • diff
  • +
  • comparison
  • raw
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/filecomparison.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial/templates/monoblue/filecomparison.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -0,0 +1,64 @@ +{header} +{repo|escape}: comparison {file|escape} + + + + + +
    + + + + + +

    {file|escape}

    + +
    + {branch%filerevbranch} +
    changeset {rev}
    +
    {node|short}
    + {parent%filecompparent} + {child%filecompchild} +
    + +
    + equal + deleted + inserted + replaced +
    + +
    + {comparison} +
    + +{footer} diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/filediff.tmpl --- a/mercurial/templates/monoblue/filediff.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/monoblue/filediff.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -35,6 +35,7 @@
  • revisions
  • annotate
  • diff
  • +
  • comparison
  • raw
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/filelog.tmpl --- a/mercurial/templates/monoblue/filelog.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/monoblue/filelog.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -35,6 +35,7 @@
  • revisions
  • annotate
  • diff
  • +
  • comparison
  • rss
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/filerevision.tmpl --- a/mercurial/templates/monoblue/filerevision.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/monoblue/filerevision.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -35,6 +35,7 @@
  • revisions
  • annotate
  • diff
  • +
  • comparison
  • raw
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/monoblue/map --- a/mercurial/templates/monoblue/map Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/monoblue/map Sun Jul 08 17:17:02 2012 +0200 @@ -26,6 +26,7 @@ file | annotate | diff | + comparison | revisions ' @@ -37,6 +38,7 @@ file | annotate | diff | + comparison | revisions ' @@ -74,6 +76,7 @@ filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl filediff = filediff.tmpl +filecomparison = filecomparison.tmpl filelog = filelog.tmpl fileline = '
    @@ -94,6 +97,27 @@ difflineminus = '{linenumber} {line|escape}' difflineat = '{linenumber} {line|escape}' diffline = '{linenumber} {line|escape}' + +comparison = ' + + + + + + + + {blocks} +
    {leftrev}:{leftnode|short}{rightrev}:{rightnode|short}
    ' +comparisonblock =' + + {lines} + ' +comparisonline = ' + + {leftlinenumber} {leftline|escape} + {rightlinenumber} {rightline|escape} + ' + changelogparent = ' parent {rev}: @@ -176,6 +200,9 @@ filediffparent = '
    parent {rev}
    {node|short}
    ' +filecompparent = ' +
    parent {rev}
    +
    {node|short}
    ' filelogparent = ' parent {rev}:  @@ -184,6 +211,9 @@ filediffchild = '
    child {rev}
    {node|short}
    ' +filecompchild = ' +
    child {rev}
    +
    {node|short}
    ' filelogchild = ' child {rev}:  diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/fileannotate.tmpl --- a/mercurial/templates/paper/fileannotate.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/paper/fileannotate.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -25,6 +25,7 @@
  • file
  • latest
  • diff
  • +
  • comparison
  • annotate
  • file log
  • raw
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/filecomparison.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mercurial/templates/paper/filecomparison.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -0,0 +1,85 @@ +{header} +{repo|escape}: {file|escape} comparison + + + +
    + + +
    +

    {repo|escape}

    +

    comparison {file|escape} @ {rev}:{node|short}

    + + + +
    {desc|strip|escape|nonempty}
    + + + + + + + + + + + + + + + + + + +{changesettag} +
    author{author|obfuscate}
    date{date|rfc822date}
    parents{parent%filerevparent}
    children{child%filerevchild}
    + +
    +
    comparison
    +
    + equal + deleted + inserted + replaced +
    + +{comparison} + +
    +
    +
    + +{footer} diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/filediff.tmpl --- a/mercurial/templates/paper/filediff.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/paper/filediff.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -24,6 +24,7 @@
  • file
  • latest
  • diff
  • +
  • comparison
  • annotate
  • file log
  • raw
  • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/filelog.tmpl --- a/mercurial/templates/paper/filelog.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/paper/filelog.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -27,6 +27,7 @@
    • file
    • diff
    • +
    • comparison
    • annotate
    • file log
    • raw
    • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/filerevision.tmpl --- a/mercurial/templates/paper/filerevision.tmpl Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/paper/filerevision.tmpl Sun Jul 08 17:17:02 2012 +0200 @@ -23,6 +23,7 @@
    • file
    • latest
    • diff
    • +
    • comparison
    • annotate
    • file log
    • raw
    • diff -r afd75476939e -r 1ae119269ddc mercurial/templates/paper/map --- a/mercurial/templates/paper/map Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/paper/map Sun Jul 08 17:17:02 2012 +0200 @@ -62,6 +62,7 @@ filerevision = filerevision.tmpl fileannotate = fileannotate.tmpl filediff = filediff.tmpl +filecomparison = filecomparison.tmpl filelog = filelog.tmpl fileline = '
      {linenumber} {line|escape}
      ' @@ -82,6 +83,26 @@ difflineat = '{linenumber} {line|escape}' diffline = '{linenumber} {line|escape}' +comparison = ' + + + + + + + + {blocks} +
      {leftrev}:{leftnode|short}{rightrev}:{rightnode|short}
      ' +comparisonblock =' + + {lines} + ' +comparisonline = ' + + {leftlinenumber} {leftline|escape} + {rightlinenumber} {rightline|escape} + ' + changelogparent = ' parent {rev}: diff -r afd75476939e -r 1ae119269ddc mercurial/templates/static/style-coal.css --- a/mercurial/templates/static/style-coal.css Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/static/style-coal.css Sun Jul 08 17:17:02 2012 +0200 @@ -286,3 +286,40 @@ position: relative; top: -3px; } + +/* Comparison */ +.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: black; + color: white; +} + +.insert { + background-color: #d0d0d0; +} + +.replace { + background-color: #f9f9f9; +} + +.header { + text-align: center; +} + +.block { + border-top: 1px solid #999; +} diff -r afd75476939e -r 1ae119269ddc mercurial/templates/static/style-gitweb.css --- a/mercurial/templates/static/style-gitweb.css Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/static/style-gitweb.css Sun Jul 08 17:17:02 2012 +0200 @@ -126,3 +126,43 @@ top: -3px; font-style: italic; } + +/* Comparison */ +.legend { + padding: 1.5% 0 1.5% 0; +} + +.legendinfo { + border: 1px solid #d9d8d1; + 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; +} + +.comparison { + overflow-x: auto; +} + +.header th { + text-align: center; +} + +.block { + border-top: 1px solid #d9d8d1; +} diff -r afd75476939e -r 1ae119269ddc mercurial/templates/static/style-monoblue.css --- a/mercurial/templates/static/style-monoblue.css Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/static/style-monoblue.css Sun Jul 08 17:17:02 2012 +0200 @@ -477,3 +477,49 @@ position: relative; } /** end of canvas **/ + +/** comparison **/ +.legend { + margin-left: 20px; + 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; +} + +.comparison { + overflow-x: auto; +} + +.comparison table td { + padding: 0px 5px; +} + +.header th { + font-weight: bold; +} + +.block { + border-top: 1px solid #999; +} +/** end of comparison **/ diff -r afd75476939e -r 1ae119269ddc mercurial/templates/static/style-paper.css --- a/mercurial/templates/static/style-paper.css Fri Jul 06 13:56:40 2012 -0700 +++ b/mercurial/templates/static/style-paper.css Sun Jul 08 17:17:02 2012 +0200 @@ -275,3 +275,39 @@ position: relative; top: -3px; } + +/* Comparison */ +.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 -r afd75476939e -r 1ae119269ddc tests/test-hgweb-commands.t --- a/tests/test-hgweb-commands.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-hgweb-commands.t Sun Jul 08 17:17:02 2012 +0200 @@ -605,6 +605,7 @@
    • file
    • latest
    • diff
    • +
    • comparison
    • annotate
    • file log
    • raw
    • diff -r afd75476939e -r 1ae119269ddc tests/test-hgweb-diffs.t --- a/tests/test-hgweb-diffs.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-hgweb-diffs.t Sun Jul 08 17:17:02 2012 +0200 @@ -227,6 +227,7 @@
    • file
    • latest
    • diff
    • +
    • comparison
    • annotate
    • file log
    • raw
    • @@ -491,6 +492,7 @@
    • file
    • latest
    • diff
    • +
    • comparison
    • annotate
    • file log
    • raw
    • @@ -549,6 +551,378 @@ + +comparison new file + + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'comparison/0/a' + 200 Script output follows + + + + + + + + + + test: a comparison + + + +
      + + +
      +

      test

      +

      comparison a @ 0:0cd96de13884

      + + + +
      a
      + + + + + + + + + + + + + + + + + + + +
      authortest
      dateThu, 01 Jan 1970 00:00:00 +0000
      parents
      children559edbd9ed20
      + +
      +
      comparison
      +
      + equal + deleted + inserted + replaced +
      + + + + + + + + + + + + + + + + + +
      -1:0000000000000:b789fdd96dc2
      1 a
      + +
      +
      +
      + + + + + + + + +comparison existing file + + $ hg up + 0 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ echo a >> a + $ hg ci -mc + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'comparison/tip/a' + 200 Script output follows + + + + + + + + + + test: a comparison + + + +
      + + +
      +

      test

      +

      comparison a @ 2:d73db4d812ff

      + + + +
      c
      + + + + + + + + + + + + + + + + + + + +
      authortest
      dateThu, 01 Jan 1970 00:00:00 +0000
      parents559edbd9ed20
      children
      + +
      +
      comparison
      +
      + equal + deleted + inserted + replaced +
      + + + + + + + + + + + + + + + + + + + + + +
      0:b789fdd96dc21:a80d06849b33
      1 a 1 a
      2 a
      + +
      +
      +
      + + + + + + + + +comparison removed file + + $ hg rm a + $ hg ci -md + $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT 'comparison/tip/a' + 200 Script output follows + + + + + + + + + + test: a comparison + + + +
      + + +
      +

      test

      +

      comparison a @ 3:20e80271eb7a

      + + + +
      d
      + + + + + + + + + + + + + + + + + + + +
      authortest
      dateThu, 01 Jan 1970 00:00:00 +0000
      parentsd73db4d812ff
      children
      + +
      +
      comparison
      +
      + equal + deleted + inserted + replaced +
      + + + + + + + + + + + + + + + + + + + + + +
      1:a80d06849b33-1:000000000000
      1 a
      2 a
      + +
      +
      +
      + + + + + + + + $ cd .. test import rev as raw-rev diff -r afd75476939e -r 1ae119269ddc tests/test-hgweb-filelog.t --- a/tests/test-hgweb-filelog.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-hgweb-filelog.t Sun Jul 08 17:17:02 2012 +0200 @@ -148,6 +148,7 @@
      • file
      • diff
      • +
      • comparison
      • annotate
      • file log
      • raw
      • @@ -249,6 +250,7 @@
        • file
        • diff
        • +
        • comparison
        • annotate
        • file log
        • raw
        • @@ -350,6 +352,7 @@
          • file
          • diff
          • +
          • comparison
          • annotate
          • file log
          • raw
          • @@ -446,6 +449,7 @@
            • file
            • diff
            • +
            • comparison
            • annotate
            • file log
            • raw
            • diff -r afd75476939e -r 1ae119269ddc tests/test-hgweb-removed.t --- a/tests/test-hgweb-removed.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-hgweb-removed.t Sun Jul 08 17:17:02 2012 +0200 @@ -171,6 +171,7 @@
            • file
            • latest
            • diff
            • +
            • comparison
            • annotate
            • file log
            • raw
            • diff -r afd75476939e -r 1ae119269ddc tests/test-hgweb.t --- a/tests/test-hgweb.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-hgweb.t Sun Jul 08 17:17:02 2012 +0200 @@ -437,6 +437,46 @@ top: -3px; font-style: italic; } + + /* Comparison */ + .legend { + padding: 1.5% 0 1.5% 0; + } + + .legendinfo { + border: 1px solid #d9d8d1; + 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; + } + + .comparison { + overflow-x: auto; + } + + .header th { + text-align: center; + } + + .block { + border-top: 1px solid #d9d8d1; + } 304 Not Modified diff -r afd75476939e -r 1ae119269ddc tests/test-highlight.t --- a/tests/test-highlight.t Fri Jul 06 13:56:40 2012 -0700 +++ b/tests/test-highlight.t Sun Jul 08 17:17:02 2012 +0200 @@ -92,6 +92,7 @@
            • file
            • latest
            • diff
            • +
            • comparison
            • annotate
            • file log
            • raw
            • @@ -222,6 +223,7 @@
            • file
            • latest
            • diff
            • +
            • comparison
            • annotate
            • file log
            • raw