Mercurial > hgbook
annotate en/examples/bisect @ 145:4aecfa5c3ab0
Drop all output from bisect.
It's not running deterministically right now.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 06 Mar 2007 21:55:07 -0800 |
parents | 153efeaa8f57 |
children | e985873a9d1a |
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 buggy_change=37 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
19 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
20 for (( i = 0; i < 50; i++ )); do |
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 hg bisect help |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
34 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 #$ name: search.init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
37 hg bisect init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
38 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
39 #$ name: search.bad-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
40 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
41 hg bisect bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
42 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 #$ name: search.good-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
44 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
45 hg bisect good 10 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
46 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 #$ name: search.step1 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
48 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
49 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 fi |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
55 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
56 echo this revision is $result |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 hg bisect $result |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
58 |
131
153efeaa8f57
Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
130
diff
changeset
|
59 #$ name: search.mytest |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
60 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
61 mytest() { |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
62 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
63 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
64 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
65 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
66 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
67 fi |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
69 echo this revision is $result |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
70 hg bisect $result |
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
73 #$ name: search.step2 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
74 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
75 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
77 #$ name: search.rest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
78 |
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 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
82 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
83 #$ name: search.reset |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
85 hg bisect reset |