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