comparison tests/test-bheads @ 4648:8e503fa54d2d

Add option to heads to show only heads for current branch.
author Eric Hopper <hopper@omnifarious.org>
date Tue, 19 Jun 2007 08:37:43 -0700
parents
children 25c372e8f261
comparison
equal deleted inserted replaced
4647:7c80e3e6f030 4648:8e503fa54d2d
1 #!/bin/sh
2
3 hg init a
4 cd a
5 echo 'root' >root
6 hg add root
7 hg commit -d '0 0' -u test -m "Adding root node"
8 hg heads
9 echo '-------'
10 hg heads .
11
12 echo '======='
13 echo 'a' >a
14 hg add a
15 hg branch a
16 hg commit -d '1 0' -u test -m "Adding a branch"
17 hg heads
18 echo '-------'
19 hg heads .
20
21 echo '======='
22 hg update -C 0
23 echo 'b' >b
24 hg add b
25 hg branch b
26 hg commit -d '2 0' -u test -m "Adding b branch"
27 hg heads
28 echo '-------'
29 hg heads .
30
31 echo '======='
32 echo 'bh1' >bh1
33 hg add bh1
34 hg commit -d '3 0' -u test -m "Adding b branch head 1"
35 hg heads
36 echo '-------'
37 hg heads .
38
39 echo '======='
40 hg update -C 2
41 echo 'bh2' >bh2
42 hg add bh2
43 hg commit -d '4 0' -u test -m "Adding b branch head 2"
44 hg heads
45 echo '-------'
46 hg heads .
47
48 echo '======='
49 hg update -C 2
50 echo 'bh3' >bh3
51 hg add bh3
52 hg commit -d '5 0' -u test -m "Adding b branch head 3"
53 hg heads
54 echo '-------'
55 hg heads .
56
57 echo '======='
58 hg merge 4
59 hg commit -d '6 0' -u test -m "Merging b branch head 2 and b branch head 3"
60 hg heads
61 echo '-------'
62 hg heads .
63
64 echo '======='
65 echo 'c' >c
66 hg add c
67 hg branch c
68 hg commit -d '7 0' -u test -m "Adding c branch"
69 hg heads
70 echo '-------'
71 hg heads .
72
73 echo '======='
74 hg heads -r 3 .
75 echo $?
76 echo '-------'
77 hg heads -r 2 .
78 echo $?
79 echo '-------'
80 hg update -C 4
81 echo $?
82 echo '-------'
83 hg heads -r 3 .
84 echo $?
85 echo '-------'
86 hg heads -r 2 .
87 echo $?
88 echo '-------'
89 hg heads -r 7 .
90 echo $?
91
92 echo '======='
93 for i in 0 1 2 3 4 5 6 7; do
94 hg update -C "$i"
95 hg heads
96 echo '-------'
97 hg heads .
98 echo '-------'
99 done
100
101 echo '======='
102 for i in a b c z; do
103 hg heads "$i"
104 echo '-------'
105 done
106
107 echo '======='
108 hg heads 0 1 2 3 4 5 6 7