hgbook

annotate en/examples/bisect @ 231:28ddbf9f3729

Use new \hgxcmd and \hgxopt commands in a few places.
author Bryan O'Sullivan <bos@serpentine.com>
date Sun May 27 09:39:58 2007 -0700 (2007-05-27)
parents e985873a9d1a
children 7a6bd93174bd
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 hg bisect help
bos@130 34
bos@130 35 #$ name: search.init
bos@130 36
bos@130 37 hg bisect init
bos@130 38
bos@130 39 #$ name: search.bad-init
bos@130 40
bos@130 41 hg bisect bad
bos@130 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