hgbook
annotate en/examples/bisect @ 130:26b7a4e943aa
Describe the bisect extension.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Thu Dec 28 14:06:15 2006 -0800 (2006-12-28) |
parents | |
children | 153efeaa8f57 |
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@130 | 6 #$ name: init |
bos@130 | 7 |
bos@130 | 8 hg init mybug |
bos@130 | 9 cd mybug |
bos@130 | 10 |
bos@130 | 11 #$ name: commits |
bos@130 | 12 |
bos@130 | 13 buggy_change=37 |
bos@130 | 14 |
bos@130 | 15 for (( i = 0; i < 50; i++ )); do |
bos@130 | 16 if [[ $i = $buggy_change ]]; then |
bos@130 | 17 echo 'i have a gub' > myfile$i |
bos@130 | 18 hg commit -q -A -m 'buggy changeset' |
bos@130 | 19 else |
bos@130 | 20 echo 'nothing to see here, move along' > myfile$i |
bos@130 | 21 hg commit -q -A -m 'normal changeset' |
bos@130 | 22 fi |
bos@130 | 23 done |
bos@130 | 24 |
bos@130 | 25 #$ name: help |
bos@130 | 26 |
bos@130 | 27 hg help bisect |
bos@130 | 28 hg bisect help |
bos@130 | 29 |
bos@130 | 30 #$ name: search.init |
bos@130 | 31 |
bos@130 | 32 hg bisect init |
bos@130 | 33 |
bos@130 | 34 #$ name: search.bad-init |
bos@130 | 35 |
bos@130 | 36 hg bisect bad |
bos@130 | 37 |
bos@130 | 38 #$ name: search.good-init |
bos@130 | 39 |
bos@130 | 40 hg bisect good 10 |
bos@130 | 41 |
bos@130 | 42 #$ name: search.step1 |
bos@130 | 43 |
bos@130 | 44 if grep -q 'i have a gub' * |
bos@130 | 45 then |
bos@130 | 46 result=bad |
bos@130 | 47 else |
bos@130 | 48 result=good |
bos@130 | 49 fi |
bos@130 | 50 |
bos@130 | 51 echo this revision is $result |
bos@130 | 52 hg bisect $result |
bos@130 | 53 |
bos@130 | 54 #$ name: mytest |
bos@130 | 55 |
bos@130 | 56 mytest() { |
bos@130 | 57 if grep -q 'i have a gub' * |
bos@130 | 58 then |
bos@130 | 59 result=bad |
bos@130 | 60 else |
bos@130 | 61 result=good |
bos@130 | 62 fi |
bos@130 | 63 |
bos@130 | 64 echo this revision is $result |
bos@130 | 65 hg bisect $result |
bos@130 | 66 } |
bos@130 | 67 |
bos@130 | 68 #$ name: search.step2 |
bos@130 | 69 |
bos@130 | 70 mytest |
bos@130 | 71 |
bos@130 | 72 #$ name: search.rest |
bos@130 | 73 |
bos@130 | 74 mytest |
bos@130 | 75 mytest |
bos@130 | 76 mytest |
bos@130 | 77 |
bos@130 | 78 #$ name: search.reset |
bos@130 | 79 |
bos@130 | 80 hg bisect reset |