Mercurial > hgbook
comparison en/examples/bisect @ 130:26b7a4e943aa
Describe the bisect extension.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu, 28 Dec 2006 14:06:15 -0800 |
parents | |
children | 153efeaa8f57 |
comparison
equal
deleted
inserted
replaced
129:73efa1a01a6c | 130:26b7a4e943aa |
---|---|
1 #!/bin/bash | |
2 | |
3 echo '[extensions]' >> $HGRC | |
4 echo 'hbisect =' >> $HGRC | |
5 | |
6 #$ name: init | |
7 | |
8 hg init mybug | |
9 cd mybug | |
10 | |
11 #$ name: commits | |
12 | |
13 buggy_change=37 | |
14 | |
15 for (( i = 0; i < 50; i++ )); do | |
16 if [[ $i = $buggy_change ]]; then | |
17 echo 'i have a gub' > myfile$i | |
18 hg commit -q -A -m 'buggy changeset' | |
19 else | |
20 echo 'nothing to see here, move along' > myfile$i | |
21 hg commit -q -A -m 'normal changeset' | |
22 fi | |
23 done | |
24 | |
25 #$ name: help | |
26 | |
27 hg help bisect | |
28 hg bisect help | |
29 | |
30 #$ name: search.init | |
31 | |
32 hg bisect init | |
33 | |
34 #$ name: search.bad-init | |
35 | |
36 hg bisect bad | |
37 | |
38 #$ name: search.good-init | |
39 | |
40 hg bisect good 10 | |
41 | |
42 #$ name: search.step1 | |
43 | |
44 if grep -q 'i have a gub' * | |
45 then | |
46 result=bad | |
47 else | |
48 result=good | |
49 fi | |
50 | |
51 echo this revision is $result | |
52 hg bisect $result | |
53 | |
54 #$ name: mytest | |
55 | |
56 mytest() { | |
57 if grep -q 'i have a gub' * | |
58 then | |
59 result=bad | |
60 else | |
61 result=good | |
62 fi | |
63 | |
64 echo this revision is $result | |
65 hg bisect $result | |
66 } | |
67 | |
68 #$ name: search.step2 | |
69 | |
70 mytest | |
71 | |
72 #$ name: search.rest | |
73 | |
74 mytest | |
75 mytest | |
76 mytest | |
77 | |
78 #$ name: search.reset | |
79 | |
80 hg bisect reset |