annotate en/examples/bisect @ 282:7a6bd93174bd

Update bisect docs
author Bryan O'Sullivan <bos@serpentine.com>
date Mon, 31 Dec 2007 20:06:58 -0800
parents cd066590e2e3
children 73b094b764ec d13a05515acf 91adcea08b33
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
1 #!/bin/bash
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
2
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
3 echo '[extensions]' >> $HGRC
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
4 echo 'hbisect =' >> $HGRC
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
5
145
4aecfa5c3ab0 Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents: 131
diff changeset
6 # XXX There's some kind of horrible nondeterminism in the execution of
4aecfa5c3ab0 Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents: 131
diff changeset
7 # bisect at the moment. Ugh.
4aecfa5c3ab0 Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents: 131
diff changeset
8
4aecfa5c3ab0 Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents: 131
diff changeset
9 #$ ignore: .*
4aecfa5c3ab0 Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents: 131
diff changeset
10
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
11 #$ name: init
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
12
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
13 hg init mybug
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
14 cd mybug
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
15
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
16 #$ name: commits
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
17
190
cd066590e2e3 Another hopeless attempt at bisect stability.
Bryan O'Sullivan <bos@serpentine.com>
parents: 147
diff changeset
18 buggy_change=22
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
19
190
cd066590e2e3 Another hopeless attempt at bisect stability.
Bryan O'Sullivan <bos@serpentine.com>
parents: 147
diff changeset
20 for (( i = 0; i < 35; i++ )); do
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
21 if [[ $i = $buggy_change ]]; then
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
22 echo 'i have a gub' > myfile$i
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
23 hg commit -q -A -m 'buggy changeset'
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
24 else
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
25 echo 'nothing to see here, move along' > myfile$i
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
26 hg commit -q -A -m 'normal changeset'
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
27 fi
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
28 done
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
29
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
30 #$ name: help
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
31
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
32 hg help bisect
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
33
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
34 #$ name: search.init
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
35
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
36 hg bisect --init
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
37
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
38 #$ name: search.bad-init
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
39
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
40 hg bisect --bad
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
41
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
42 #$ name: search.good-init
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
43
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
44 hg bisect --good 10
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
45
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
46 #$ name: search.step1
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
47
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
48 if grep -q 'i have a gub' *
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
49 then
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
50 result=bad
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
51 else
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
52 result=good
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
53 fi
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
54
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
55 echo this revision is $result
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
56 hg bisect --$result
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
57
131
153efeaa8f57 Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents: 130
diff changeset
58 #$ name: search.mytest
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
59
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
60 mytest() {
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
61 if grep -q 'i have a gub' *
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
62 then
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
63 result=bad
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
64 else
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
65 result=good
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
66 fi
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
67
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
68 echo this revision is $result
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
69 hg bisect --$result
130
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
70 }
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
71
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
72 #$ name: search.step2
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
73
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
74 mytest
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
75
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
76 #$ name: search.rest
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
77
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
78 mytest
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
79 mytest
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
80 mytest
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
81
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
82 #$ name: search.reset
26b7a4e943aa Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff changeset
83
282
7a6bd93174bd Update bisect docs
Bryan O'Sullivan <bos@serpentine.com>
parents: 190
diff changeset
84 hg bisect --reset
147
e985873a9d1a Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents: 145
diff changeset
85
e985873a9d1a Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents: 145
diff changeset
86 #$ name:
e985873a9d1a Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents: 145
diff changeset
87
e985873a9d1a Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents: 145
diff changeset
88 exit 0