annotate tests/test-convert-splicemap @ 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 5b7da468531b
children bb5ea66789e3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8047
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
1 #!/bin/sh
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 echo "[extensions]" >> $HGRCPATH
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 echo "convert=" >> $HGRCPATH
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5 echo 'hgext.graphlog =' >> $HGRCPATH
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 glog()
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 {
8523
5b7da468531b tests: replace #...# syntax with {...}
Martin Geisler <mg@lazybytes.net>
parents: 8047
diff changeset
9 hg glog --template '{rev} "{desc|firstline}" files: {files}\n' "$@"
8047
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 }
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 hg init repo1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 cd repo1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 echo a > a
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 hg ci -Am adda
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 echo b > b
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 echo a >> a
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 hg ci -Am addb
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 PARENTID1=`hg id --debug -i`
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 echo c > c
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 hg ci -Am addc
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 PARENTID2=`hg id --debug -i`
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 cd ..
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25 hg init repo2
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 cd repo2
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 echo b > a
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 echo d > d
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 hg ci -Am addaandd
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 CHILDID1=`hg id --debug -i`
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 echo d >> d
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 hg ci -Am changed
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 CHILDID2=`hg id --debug -i`
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 echo e > e
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 hg ci -Am adde
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 cd ..
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 echo '% test invalid splicemap'
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 cat > splicemap <<EOF
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40 $CHILDID2
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
41 EOF
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42 hg convert --splicemap splicemap repo2 repo1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 echo '% splice repo2 on repo1'
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45 cat > splicemap <<EOF
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 $CHILDID1 $PARENTID1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 $CHILDID2 $PARENTID2,$CHILDID1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 EOF
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 hg clone repo1 target1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50 hg convert --splicemap splicemap repo2 target1
04c62275cbc7 convert: better mapfile parsing errors (issue1581/1)
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 glog -R target1