Mercurial > hg
comparison tests/test-hgweb-diffs.t @ 16308:2695aaf4eb72
hgweb: add block numbers to diff regions and related links
The changeset view may show several diff regions, one per file, and this patch
numbers each of them so that links produced by the filenodelink fragment can
reference each diff region produced by the diffblock fragment through the use
of the blockno variable made available to both of them. This permits
navigation to diff regions on the changeset page from the file list, and
where the :target pseudo-class is supported in browsers, permits selective
presentation of diffs, showing one at a time instead of potentially many in
what would otherwise be a very long page that is difficult to navigate.
author | Paul Boddie <paul@boddie.org.uk> |
---|---|
date | Fri, 23 Mar 2012 01:31:31 +0100 |
parents | c5c9ca3719f9 |
children | 7bf48bc7de23 |
comparison
equal
deleted
inserted
replaced
16307:17a9a1f5cee2 | 16308:2695aaf4eb72 |
---|---|
550 updating to branch default | 550 updating to branch default |
551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | 551 2 files updated, 0 files merged, 0 files removed, 0 files unresolved |
552 $ cd test1 | 552 $ cd test1 |
553 $ hg import -q --exact http://localhost:$HGPORT/rev/1 | 553 $ hg import -q --exact http://localhost:$HGPORT/rev/1 |
554 | 554 |
555 raw revision with diff block numbers | |
556 | |
557 $ "$TESTDIR/killdaemons.py" | |
558 $ cat <<EOF > .hg/hgrc | |
559 > [web] | |
560 > templates = rawdiff | |
561 > EOF | |
562 $ mkdir rawdiff | |
563 $ cat <<EOF > rawdiff/map | |
564 > mimetype = 'text/plain; charset={encoding}' | |
565 > changeset = '{diff}' | |
566 > difflineplus = '{line}' | |
567 > difflineminus = '{line}' | |
568 > difflineat = '{line}' | |
569 > diffline = '{line}' | |
570 > filenodelink = '' | |
571 > filenolink = '' | |
572 > fileline = '{line}' | |
573 > diffblock = 'Block: {blockno}\n{lines}\n' | |
574 > EOF | |
575 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
576 $ cat hg.pid >> $DAEMON_PIDS | |
577 $ "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' | |
578 200 Script output follows | |
579 | |
580 Block: 1 | |
581 diff -r 000000000000 -r 0cd96de13884 a | |
582 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
583 +++ b/a Thu Jan 01 00:00:00 1970 +0000 | |
584 @@ -0,0 +1,1 @@ | |
585 +a | |
586 | |
587 Block: 2 | |
588 diff -r 000000000000 -r 0cd96de13884 b | |
589 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
590 +++ b/b Thu Jan 01 00:00:00 1970 +0000 | |
591 @@ -0,0 +1,1 @@ | |
592 +b | |
593 | |
594 $ "$TESTDIR/killdaemons.py" | |
595 $ rm .hg/hgrc rawdiff/map | |
596 $ rmdir rawdiff | |
597 $ hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log | |
598 $ cat hg.pid >> $DAEMON_PIDS | |
599 | |
555 errors | 600 errors |
556 | 601 |
557 $ cat ../test/errors.log | 602 $ cat ../test/errors.log |