Mercurial > hg
annotate tests/test-hgweb-diffs @ 9827:4fe9ca519637
mdiff: fix diff -b/B/w on mixed whitespace hunks (issue127)
Previous code was computing hunks then checking if these hunks could be ignored
when taking whitespace/blank-lines options in accounts. This approach is simple
but fails with hunks containing both whitespace and non-whitespace changes, the
whole hunk is emitted while it can be mostly made of whitespace. The new
version normalize the whitespaces before hunk generation, and test for
blank-lines afterwards.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Wed, 11 Nov 2009 18:31:42 +0100 |
parents | ffda19f351fa |
children |
rev | line source |
---|---|
8452
cb93eee1fbcd
tests: add missing interpreter lines
Martin Geisler <mg@lazybytes.net>
parents:
7428
diff
changeset
|
1 #!/bin/sh |
cb93eee1fbcd
tests: add missing interpreter lines
Martin Geisler <mg@lazybytes.net>
parents:
7428
diff
changeset
|
2 |
7309
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
3 echo % setting up repo |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
4 hg init test |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
5 cd test |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
6 echo a > a |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
7 echo b > b |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
8 hg ci -Ama |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
9 |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
10 echo % change permissions for git diffs |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
11 chmod 755 a |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
12 hg ci -Amb |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
13 |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
14 echo % set up hgweb |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
15 hg serve -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
16 cat hg.pid >> $DAEMON_PIDS |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
17 |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
18 echo % revision |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
19 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0' |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
20 |
9402
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
21 echo % raw revision |
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
22 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' |
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
23 |
7309
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
24 echo % diff removed file |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
25 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a' |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
26 |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
27 echo % set up hgweb with git diffs |
7428
fdcde929ce4f
tests: use killdaemons in hgweb tests
Mads Kiilerich <mads@kiilerich.com>
parents:
7309
diff
changeset
|
28 "$TESTDIR/killdaemons.py" |
7309
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
29 hg serve --config 'diff.git=1' -n test -p $HGPORT -d --pid-file=hg.pid -A access.log -E errors.log |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
30 cat hg.pid >> $DAEMON_PIDS |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
31 |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
32 echo % revision |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
33 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/rev/0' |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
34 |
9402
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
35 echo % revision |
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
36 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/raw-rev/0' |
5d49fdef6fd0
hgweb: show diff header line in raw diffs
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
8452
diff
changeset
|
37 |
7309
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
38 echo % diff removed file |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
39 "$TESTDIR/get-with-headers.py" localhost:$HGPORT '/diff/tip/a' |
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
40 |
9731
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
41 cd .. |
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
42 echo % test import rev as raw-rev |
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
43 hg clone -r0 test test1 |
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
44 cd test1 |
9753 | 45 hg import -q --exact http://localhost:$HGPORT/rev/1 |
9731
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
46 |
7309
e74a9173c2d7
hgweb: use patch.diff() to make sensible diffs (issue1223, issue1258)
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
diff
changeset
|
47 echo % errors |
9731
0e080d519d1b
hgweb: treat rev as raw-rev if user agent is hg
Dirkjan Ochtman <dirkjan@ochtman.nl>
parents:
9402
diff
changeset
|
48 cat ../test/errors.log |