hgbook

annotate en/examples/backout @ 222:b2b593eb56e7

Add sillybench script.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue May 15 14:52:41 2007 -0700 (2007-05-15)
parents 627effec9d4e
children 7226e5e750a6
rev   line source
bos@124 1 #!/bin/bash
bos@124 2
bos@124 3 # We have to fake the merges here, because they cause conflicts with
bos@124 4 # three-way command-line merge, and kdiff3 may not be available.
bos@124 5
bos@124 6 export HGMERGE=$(mktemp)
bos@124 7 echo '#!/bin/sh' >> $HGMERGE
bos@124 8 echo 'echo first change > "$1"' >> $HGMERGE
bos@179 9 echo 'echo third change >> "$1"' >> $HGMERGE
bos@124 10 chmod 700 $HGMERGE
bos@124 11
bos@124 12 #$ name: init
bos@124 13
bos@124 14 hg init myrepo
bos@124 15 cd myrepo
bos@124 16 echo first change >> myfile
bos@124 17 hg add myfile
bos@124 18 hg commit -m 'first change'
bos@124 19 echo second change >> myfile
bos@124 20 hg commit -m 'second change'
bos@124 21
bos@124 22 #$ name: simple
bos@124 23
bos@124 24 hg backout -m 'back out second change' tip
bos@124 25 cat myfile
bos@124 26
bos@124 27 #$ name: simple.log
bos@141 28 #$ ignore: \s+200[78]-.*
bos@124 29
bos@124 30 hg log --style compact
bos@124 31
bos@124 32 #$ name: non-tip.clone
bos@124 33
bos@124 34 cd ..
bos@124 35 hg clone -r1 myrepo non-tip-repo
bos@124 36 cd non-tip-repo
bos@124 37
bos@124 38 #$ name: non-tip.backout
bos@124 39
bos@124 40 echo third change >> myfile
bos@124 41 hg commit -m 'third change'
bos@124 42 hg backout --merge -m 'back out second change' 1
bos@124 43
bos@124 44 #$ name: non-tip.cat
bos@124 45 cat myfile
bos@124 46
bos@124 47 #$ name: manual.clone
bos@124 48
bos@124 49 cd ..
bos@124 50 hg clone -r1 myrepo newrepo
bos@124 51 cd newrepo
bos@124 52
bos@124 53 #$ name: manual.backout
bos@124 54
bos@124 55 echo third change >> myfile
bos@124 56 hg commit -m 'third change'
bos@124 57 hg backout -m 'back out second change' 1
bos@124 58
bos@124 59 #$ name: manual.log
bos@124 60
bos@124 61 hg log --style compact
bos@124 62
bos@124 63 #$ name: manual.parents
bos@124 64
bos@124 65 hg parents
bos@124 66
bos@124 67 #$ name: manual.heads
bos@124 68
bos@124 69 hg heads
bos@124 70
bos@124 71 #$ name: manual.cat
bos@124 72
bos@124 73 cat myfile
bos@124 74
bos@124 75 #$ name: manual.merge
bos@124 76
bos@124 77 hg merge
bos@124 78 hg commit -m 'merged backout with previous tip'
bos@124 79 cat myfile
bos@124 80
bos@124 81 #$ name:
bos@124 82
bos@124 83 rm $HGMERGE