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