|
1 #!/bin/sh |
|
2 |
|
3 echo "[extensions]" >> $HGRCPATH |
|
4 echo "autodiff=$TESTDIR/autodiff.py" >> $HGRCPATH |
|
5 echo "[diff]" >> $HGRCPATH |
|
6 echo "nodates=1" >> $HGRCPATH |
|
7 |
|
8 hg init repo |
|
9 cd repo |
|
10 echo '% make a combination of new, changed and deleted file' |
|
11 echo regular > regular |
|
12 echo rmregular > rmregular |
|
13 touch rmempty |
|
14 echo exec > exec |
|
15 chmod +x exec |
|
16 echo rmexec > rmexec |
|
17 chmod +x rmexec |
|
18 echo setexec > setexec |
|
19 echo unsetexec > unsetexec |
|
20 chmod +x unsetexec |
|
21 echo binary > binary |
|
22 python -c "file('rmbinary', 'wb').write('\0')" |
|
23 hg ci -Am addfiles |
|
24 echo regular >> regular |
|
25 echo newregular >> newregular |
|
26 rm rmempty |
|
27 touch newempty |
|
28 rm rmregular |
|
29 echo exec >> exec |
|
30 echo newexec > newexec |
|
31 chmod +x newexec |
|
32 rm rmexec |
|
33 chmod +x setexec |
|
34 chmod -x unsetexec |
|
35 python -c "file('binary', 'wb').write('\0\0')" |
|
36 python -c "file('newbinary', 'wb').write('\0')" |
|
37 rm rmbinary |
|
38 hg addremove |
|
39 |
|
40 echo '% git=no: regular diff for all files' |
|
41 hg autodiff --git=no |
|
42 |
|
43 echo '% git=no: git diff for single regular file' |
|
44 hg autodiff --git=yes regular |
|
45 |
|
46 echo '% git=auto: regular diff for regular files and removals' |
|
47 hg autodiff --git=auto regular newregular rmregular rmbinary rmexec |
|
48 |
|
49 for f in exec newexec setexec unsetexec binary newbinary newempty rmempty; do |
|
50 echo '% git=auto: git diff for' $f |
|
51 hg autodiff --git=auto $f |
|
52 done |
|
53 |
|
54 echo '% git=warn: regular diff with data loss warnings' |
|
55 hg autodiff --git=warn |
|
56 |
|
57 echo '% git=abort: fail on execute bit change' |
|
58 hg autodiff --git=abort regular setexec |
|
59 |
|
60 echo '% git=abort: succeed on regular file' |
|
61 hg autodiff --git=abort regular |
|
62 |
|
63 cd .. |