hgbook
annotate en/examples/bisect @ 166:08a4467f4891
Try to get the bisect extension to behave.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon Mar 26 22:59:43 2007 -0700 (2007-03-26) |
parents | e985873a9d1a |
children | f8b5b782e150 |
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@130 | 9 #$ name: init |
bos@130 | 10 |
bos@130 | 11 hg init mybug |
bos@130 | 12 cd mybug |
bos@130 | 13 |
bos@130 | 14 #$ name: commits |
bos@130 | 15 |
bos@130 | 16 buggy_change=37 |
bos@130 | 17 |
bos@130 | 18 for (( i = 0; i < 50; i++ )); do |
bos@130 | 19 if [[ $i = $buggy_change ]]; then |
bos@130 | 20 echo 'i have a gub' > myfile$i |
bos@130 | 21 hg commit -q -A -m 'buggy changeset' |
bos@130 | 22 else |
bos@130 | 23 echo 'nothing to see here, move along' > myfile$i |
bos@130 | 24 hg commit -q -A -m 'normal changeset' |
bos@130 | 25 fi |
bos@130 | 26 done |
bos@130 | 27 |
bos@130 | 28 #$ name: help |
bos@130 | 29 |
bos@130 | 30 hg help bisect |
bos@130 | 31 hg bisect help |
bos@130 | 32 |
bos@130 | 33 #$ name: search.init |
bos@130 | 34 |
bos@130 | 35 hg bisect init |
bos@130 | 36 |
bos@130 | 37 #$ name: search.bad-init |
bos@130 | 38 |
bos@130 | 39 hg bisect bad |
bos@130 | 40 |
bos@166 | 41 #$ drop_output: yes |
bos@166 | 42 |
bos@130 | 43 #$ name: search.good-init |
bos@130 | 44 |
bos@130 | 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@130 | 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@130 | 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@130 | 85 hg bisect reset |
bos@147 | 86 |
bos@147 | 87 #$ name: |
bos@147 | 88 |
bos@147 | 89 exit 0 |