File: test-bisect2

package info (click to toggle)
mercurial 1.6.4-1%2Bdeb6u1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze-lts
  • size: 17,928 kB
  • ctags: 6,062
  • sloc: python: 44,238; sh: 20,985; tcl: 3,578; ansic: 2,557; lisp: 1,412; makefile: 176; xml: 15
file content (153 lines) | stat: -rwxr-xr-x 2,996 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
#!/bin/sh

# The tests in test-bisect are done on a linear history.
# Here the following repository history is used for testing:
#
#                     17
#                      |
#               18    16 
#                 \  /
#                  15
#                 /  \
#                /    \
#              10     13
#              / \     |
#             /   \    |  14
#        7   6     9  12 /
#         \ / \    |   |/
#          4   \   |  11
#           \   \  |  /
#            3   5 | /
#             \ /  |/ 
#              2   8
#               \ /
#                1
#                |
#                0

set -e

echo % init
hg init

echo % committing changes
echo > a
echo '0' >> a
hg add a
hg ci -m "0" -d "0 0"
echo '1' >> a
hg ci -m "1" -d "1 0"
echo '2' >> a
hg ci -m "2" -d "2 0"
echo '3' >> a
hg ci -m "3" -d "3 0"
echo '4' >> a
hg ci -m "4" -d "4 0"
# create branch
hg up -r 2
echo '5' >> b
hg add b
hg ci -m "5" -d "5 0"

# merge
hg merge
hg ci -m "merge 4,5" -d "6 0"

# create branch
hg up -r 4
echo '7' > c
hg add c
hg ci -m "7" -d "7 0"

# create branch
hg up -r 1
echo '8' > d
hg add d
hg ci -m "8" -d "8 0"
echo '9' >> d
hg ci -m "9" -d "9 0"

# merge
hg merge -r 6
hg ci -m "merge 6,9" -d "10 0"

# create branch
hg up -r 8
echo '11' > e
hg add e
hg ci -m "11" -d "11 0"
echo '12' >> e
hg ci -m "12" -d "12 0"
echo '13' >> e
hg ci -m "13" -d "13 0"

# create branch
hg up -r 11
echo '14' > f
hg add f
hg ci -m "14" -d "14 0"

# merge
hg up -r 13 -C
hg merge -r 10
hg ci -m "merge 10,13" -d "15 0"
echo '16' >> e
hg ci -m "16" -d "16 0"
echo '17' >> e
hg ci -m "17" -d "17 0"

# create branch
hg up -r 15
echo '18' >> e
hg ci -m "18" -d "18 0"


echo % log
hg log

echo % hg up -C
hg up -C

echo % complex bisect test 1  # first bad rev is 9
hg bisect -r
hg bisect -g 0
hg bisect -b 17   # -> update to rev 6
hg bisect -g      # -> update to rev 13
hg bisect -s      # -> update to rev 10
hg bisect -b      # -> update to rev 8
hg bisect -g      # -> update to rev 9
hg bisect -b

echo % complex bisect test 2  # first good rev is 13
hg bisect -r
hg bisect -g 18
hg bisect -b 1    # -> update to rev 6
hg bisect -s      # -> update to rev 10
hg bisect -b      # -> update to rev 12
hg bisect -b      # -> update to rev 13
hg bisect -g

echo % complex bisect test 3  
# first bad rev is 15 
# 10,9,13 are skipped an might be the first bad revisions as well
hg bisect -r
hg bisect -g 1
hg bisect -b 16   # -> update to rev 6
hg bisect -g      # -> update to rev 13
hg bisect -s      # -> update to rev 10
hg bisect -s      # -> update to rev 12
hg bisect -g      # -> update to rev 9
hg bisect -s      # -> update to rev 15
hg bisect -b

echo % complex bisect test 4
# first good revision is 17
# 15,16 are skipped an might be the first good revisions as well
hg bisect -r
hg bisect -g 17
hg bisect -b 8    # -> update to rev 10
hg bisect -b      # -> update to rev 13
hg bisect -b      # -> update to rev 15
hg bisect -s      # -> update to rev 16
hg bisect -s