hgbook
annotate fr/examples/bisect @ 963:1dd00abb3fa9
merge with bryan - it's been a while but everything seems ok
author | Romain PELISSE <belaran@gmail.com> |
---|---|
date | Sun Aug 16 03:41:39 2009 +0200 (2009-08-16) |
parents | en/examples/bisect@7226e5e750a6 en/examples/bisect@547d3aa25ef0 |
children |
rev | line source |
---|---|
bos@130 | 1 #!/bin/bash |
bos@130 | 2 |
igor@332 | 3 if hg -v | head -1 | grep -e "version 0.*" |
igor@332 | 4 then |
igor@332 | 5 #On mercurial 1.0 and later bisect is a builtin |
bos@130 | 6 echo '[extensions]' >> $HGRC |
bos@130 | 7 echo 'hbisect =' >> $HGRC |
igor@332 | 8 fi |
bos@130 | 9 |
bos@145 | 10 # XXX There's some kind of horrible nondeterminism in the execution of |
bos@145 | 11 # bisect at the moment. Ugh. |
bos@145 | 12 |
bos@145 | 13 #$ ignore: .* |
bos@145 | 14 |
bos@130 | 15 #$ name: init |
bos@130 | 16 |
bos@130 | 17 hg init mybug |
bos@130 | 18 cd mybug |
bos@130 | 19 |
bos@130 | 20 #$ name: commits |
bos@130 | 21 |
bos@190 | 22 buggy_change=22 |
bos@130 | 23 |
bos@190 | 24 for (( i = 0; i < 35; i++ )); do |
bos@130 | 25 if [[ $i = $buggy_change ]]; then |
bos@130 | 26 echo 'i have a gub' > myfile$i |
bos@130 | 27 hg commit -q -A -m 'buggy changeset' |
bos@130 | 28 else |
bos@130 | 29 echo 'nothing to see here, move along' > myfile$i |
bos@130 | 30 hg commit -q -A -m 'normal changeset' |
bos@130 | 31 fi |
bos@130 | 32 done |
bos@130 | 33 |
bos@130 | 34 #$ name: help |
bos@130 | 35 |
bos@130 | 36 hg help bisect |
bos@130 | 37 |
bos@130 | 38 #$ name: search.init |
bos@130 | 39 |
bos@680 | 40 hg bisect --reset |
bos@130 | 41 |
bos@130 | 42 #$ name: search.bad-init |
bos@130 | 43 |
bos@680 | 44 hg bisect --bad |
bos@130 | 45 |
bos@130 | 46 #$ name: search.good-init |
bos@130 | 47 |
bos@680 | 48 hg bisect --good 10 |
bos@130 | 49 |
bos@130 | 50 #$ name: search.step1 |
bos@130 | 51 |
bos@130 | 52 if grep -q 'i have a gub' * |
bos@130 | 53 then |
bos@130 | 54 result=bad |
bos@130 | 55 else |
bos@130 | 56 result=good |
bos@130 | 57 fi |
bos@130 | 58 |
bos@130 | 59 echo this revision is $result |
bos@282 | 60 hg bisect --$result |
bos@130 | 61 |
bos@131 | 62 #$ name: search.mytest |
bos@130 | 63 |
bos@130 | 64 mytest() { |
bos@130 | 65 if grep -q 'i have a gub' * |
bos@130 | 66 then |
bos@130 | 67 result=bad |
bos@130 | 68 else |
bos@130 | 69 result=good |
bos@130 | 70 fi |
bos@130 | 71 |
bos@130 | 72 echo this revision is $result |
bos@680 | 73 hg bisect --$result |
bos@130 | 74 } |
bos@130 | 75 |
bos@130 | 76 #$ name: search.step2 |
bos@130 | 77 |
bos@130 | 78 mytest |
bos@130 | 79 |
bos@130 | 80 #$ name: search.rest |
bos@130 | 81 |
bos@130 | 82 mytest |
bos@130 | 83 mytest |
bos@130 | 84 mytest |
bos@130 | 85 |
bos@130 | 86 #$ name: search.reset |
bos@130 | 87 |
bos@680 | 88 hg bisect --reset |
bos@147 | 89 |
bos@147 | 90 #$ name: |
bos@147 | 91 |
bos@147 | 92 exit 0 |