Mercurial > hgbook
annotate en/examples/bisect @ 484:0abd3d78172e
finished translation of a figure
translated a few paragraphs of tour-merge
author | Javier Rojas <jerojasro@devnull.li> |
---|---|
date | Sun, 02 Nov 2008 13:54:42 -0500 |
parents | d13a05515acf |
children | 51b5d56744c5 |
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 |
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
|
40 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
|
41 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
|
42 #On mercurial 1.0 --init disappeared |
282 | 43 hg bisect --init |
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
|
44 fi |
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.bad-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
47 |
282 | 48 hg bisect --bad |
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.good-init |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
51 |
282 | 52 hg bisect --good 10 |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
53 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
54 #$ name: search.step1 |
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 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
57 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
58 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
59 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
60 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
61 fi |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
62 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
63 echo this revision is $result |
282 | 64 hg bisect --$result |
130
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
65 |
131
153efeaa8f57
Fix stupid build bugs.
Bryan O'Sullivan <bos@serpentine.com>
parents:
130
diff
changeset
|
66 #$ name: search.mytest |
130
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 mytest() { |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
69 if grep -q 'i have a gub' * |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
70 then |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
71 result=bad |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
72 else |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
73 result=good |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
74 fi |
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 echo this revision is $result |
282 | 77 hg bisect --$result |
130
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
80 #$ name: search.step2 |
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 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
84 #$ name: search.rest |
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 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
87 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
88 mytest |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
89 |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
90 #$ name: search.reset |
26b7a4e943aa
Describe the bisect extension.
Bryan O'Sullivan <bos@serpentine.com>
parents:
diff
changeset
|
91 |
282 | 92 hg bisect --reset |
147
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
93 |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
94 #$ name: |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
95 |
e985873a9d1a
Work around bisect sometimes failing.
Bryan O'Sullivan <bos@serpentine.com>
parents:
145
diff
changeset
|
96 exit 0 |