1 #!/bin/sh |
|
2 |
|
3 . $TESTDIR/helpers.sh |
|
4 |
|
5 echo "[extensions]" >> $HGRCPATH |
|
6 echo "graphlog=" >> $HGRCPATH |
|
7 echo "rebase=" >> $HGRCPATH |
|
8 |
|
9 BASE=`pwd` |
|
10 |
|
11 addcommit () { |
|
12 echo $1 > $1 |
|
13 hg add $1 |
|
14 hg commit -d "${2} 0" -m $1 |
|
15 } |
|
16 |
|
17 commit () { |
|
18 hg commit -d "${2} 0" -m $1 |
|
19 } |
|
20 |
|
21 createrepo () { |
|
22 cd $BASE |
|
23 rm -rf a |
|
24 hg init a |
|
25 cd a |
|
26 addcommit "A" 0 |
|
27 addcommit "B" 1 |
|
28 addcommit "C" 2 |
|
29 addcommit "D" 3 |
|
30 |
|
31 hg update -C 0 |
|
32 addcommit "E" 4 |
|
33 } |
|
34 |
|
35 createrepo > /dev/null 2>&1 |
|
36 hg glog --template '{rev}: {desc}\n' |
|
37 echo '% Rebasing D onto E detaching from C' |
|
38 hg rebase --detach -s 3 -d 4 | hidebackup |
|
39 hg glog --template '{rev}: {desc}\n' |
|
40 echo "Expected A, D, E" |
|
41 hg manifest |
|
42 |
|
43 echo |
|
44 createrepo > /dev/null 2>&1 |
|
45 hg glog --template '{rev}: {desc}\n' |
|
46 echo '% Rebasing C onto E detaching from B' |
|
47 hg rebase --detach -s 2 -d 4 | hidebackup |
|
48 hg glog --template '{rev}: {desc}\n' |
|
49 echo "Expected A, C, D, E" |
|
50 hg manifest |
|
51 |
|
52 echo |
|
53 createrepo > /dev/null 2>&1 |
|
54 hg glog --template '{rev}: {desc}\n' |
|
55 echo '% Rebasing B onto E using detach (same as not using it)' |
|
56 hg rebase --detach -s 1 -d 4 | hidebackup |
|
57 hg glog --template '{rev}: {desc}\n' |
|
58 echo "Expected A, B, C, D, E" |
|
59 hg manifest |
|
60 |
|
61 echo |
|
62 createrepo > /dev/null 2>&1 |
|
63 hg glog --template '{rev}: {desc}\n' |
|
64 echo '% Rebasing C onto E detaching from B and collapsing' |
|
65 hg rebase --detach --collapse -s 2 -d 4 | hidebackup |
|
66 hg glog --template '{rev}: {desc}\n' |
|
67 echo "Expected A, C, D, E" |
|
68 hg manifest |
|
69 |
|
70 exit 0 |
|