2907
|
1 #!/bin/sh
|
|
2
|
|
3 hg init a
|
|
4 cd a
|
|
5
|
|
6 echo start > start
|
|
7 hg ci -Amstart -d '0 0'
|
|
8 echo new > new
|
|
9 hg ci -Amnew -d '0 0'
|
|
10 echo '% new file'
|
|
11 hg diff --git -r 0 | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|
|
12
|
|
13 hg cp new copy
|
|
14 hg ci -mcopy -d '0 0'
|
|
15 echo '% copy'
|
|
16 hg diff --git -r 1:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|
|
17
|
|
18 hg mv copy rename
|
|
19 hg ci -mrename -d '0 0'
|
|
20 echo '% rename'
|
|
21 hg diff --git -r 2:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|
|
22
|
|
23 hg rm rename
|
|
24 hg ci -mdelete -d '0 0'
|
|
25 echo '% delete'
|
|
26 hg diff --git -r 3:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|
|
27
|
|
28 cat > src <<EOF
|
|
29 1
|
|
30 2
|
|
31 3
|
|
32 4
|
|
33 5
|
|
34 EOF
|
|
35 hg ci -Amsrc -d '0 0'
|
|
36 chmod +x src
|
|
37 hg ci -munexec -d '0 0'
|
|
38 echo '% chmod 644'
|
|
39 hg diff --git -r 5:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|
|
40
|
|
41 hg mv src dst
|
|
42 chmod -x dst
|
|
43 echo a >> dst
|
|
44 hg ci -mrenamemod -d '0 0'
|
|
45 echo '% rename+mod+chmod'
|
|
46 hg diff --git -r 6:tip | sed "s/\(\(---\|+++\) [a-zA-Z0-9_/.-]*\).*/\1/"
|