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