Mercurial > hgbook
annotate en/examples/bisect @ 820:3edacbff2b43
Add more details on Subversion conversion.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Tue, 28 Apr 2009 22:49:50 -0700 |
parents | 7226e5e750a6 |
children |
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 |
431
d13a05515acf
Fixing problem on bisect that inhibits building with mercurial 1.0 or later
Igor Támara <igor@tamarapatino.org>
parents:
282
diff
changeset
|
3 if hg -v | head -1 | grep -e "version 0.*" |
d13a05515acf
Fixing problem on bisect that inhibits building with mercurial 1.0 or later
Igor Támara <igor@tamarapatino.org>
parents:
282
diff
changeset
|
4 then |
d13a05515acf
Fixing problem on bisect that inhibits building with mercurial 1.0 or later
Igor Támara <igor@tamarapatino.org>
parents:
282
diff
changeset
|
5 #On mercurial 1.0 and later bisect is a builtin |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
6 echo '[extensions]' >> $HGRC |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
7 echo 'hbisect =' >> $HGRC |
431
d13a05515acf
Fixing problem on bisect that inhibits building with mercurial 1.0 or later
Igor Támara <igor@tamarapatino.org>
parents:
282
diff
changeset
|
8 fi |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
9 |
145
4aecfa5c3ab0
Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents:
131
diff
changeset
|
10 # 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
|
11 # bisect at the moment. Ugh. |
4aecfa5c3ab0
Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents:
131
diff
changeset
|
12 |
4aecfa5c3ab0
Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents:
131
diff
changeset
|
13 #$ ignore: .* |
4aecfa5c3ab0
Drop all output from bisect.
Bryan O'Sullivan <bos@serpentine.com>
parents:
131
diff
changeset
|
14 |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
15 #$ name: init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
16 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
17 hg init mybug |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
18 cd mybug |
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 #$ name: commits |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
21 |
190
cd066590e2e3
Another hopeless attempt at bisect stability.
Bryan O'Sullivan <bos@serpentine.com>
parents:
147
diff
changeset
|
22 buggy_change=22 |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
23 |
190
cd066590e2e3
Another hopeless attempt at bisect stability.
Bryan O'Sullivan <bos@serpentine.com>
parents:
147
diff
changeset
|
24 for (( i = 0; i < 35; i++ )); do |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
25 if [[ $i = $buggy_change ]]; then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
26 echo 'i have a gub' > myfile$i |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
27 hg commit -q -A -m 'buggy changeset' |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
28 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
29 echo 'nothing to see here, move along' > myfile$i |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
30 hg commit -q -A -m 'normal changeset' |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
31 fi |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
32 done |
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: help |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
35 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
36 hg help bisect |
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.init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
39 |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
654
diff
changeset
|
40 hg bisect --reset |
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.bad-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
43 |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
654
diff
changeset
|
44 hg bisect --bad |
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.good-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
654
diff
changeset
|
48 hg bisect --good 10 |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
49 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
50 #$ name: search.step1 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
52 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
55 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
56 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 fi |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
58 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
59 echo this revision is $result |
282 | 60 hg bisect --$result |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
61 |
131
153efeaa8f57
Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
130
diff
changeset
|
62 #$ name: search.mytest |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
63 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
64 mytest() { |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
65 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
66 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
67 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
68 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
69 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
70 fi |
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 echo this revision is $result |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
654
diff
changeset
|
73 hg bisect --$result |
130
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
76 #$ name: search.step2 |
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
80 #$ name: search.rest |
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 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
83 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
85 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
86 #$ name: search.reset |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
87 |
807
7226e5e750a6
Clean up chapter 8, and add content
Bryan O'Sullivan <bos@serpentine.com>
parents:
654
diff
changeset
|
88 hg bisect --reset |
147
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
89 |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
90 #$ name: |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
91 |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
92 exit 0 |