hgbook

annotate en/examples/backout @ 124:c9aad709bd3a

Document the backout command.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue Dec 26 13:08:20 2006 -0800 (2006-12-26)
parents
children 627effec9d4e
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@124 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@124 28
bos@124 29 hg log --style compact
bos@124 30
bos@124 31 #$ name: non-tip.clone
bos@124 32
bos@124 33 cd ..
bos@124 34 hg clone -r1 myrepo non-tip-repo
bos@124 35 cd non-tip-repo
bos@124 36
bos@124 37 #$ name: non-tip.backout
bos@124 38
bos@124 39 echo third change >> myfile
bos@124 40 hg commit -m 'third change'
bos@124 41 hg backout --merge -m 'back out second change' 1
bos@124 42
bos@124 43 #$ name: non-tip.cat
bos@124 44 cat myfile
bos@124 45
bos@124 46 #$ name: manual.clone
bos@124 47
bos@124 48 cd ..
bos@124 49 hg clone -r1 myrepo newrepo
bos@124 50 cd newrepo
bos@124 51
bos@124 52 #$ name: manual.backout
bos@124 53
bos@124 54 echo third change >> myfile
bos@124 55 hg commit -m 'third change'
bos@124 56 hg backout -m 'back out second change' 1
bos@124 57
bos@124 58 #$ name: manual.log
bos@124 59
bos@124 60 hg log --style compact
bos@124 61
bos@124 62 #$ name: manual.parents
bos@124 63
bos@124 64 hg parents
bos@124 65
bos@124 66 #$ name: manual.heads
bos@124 67
bos@124 68 hg heads
bos@124 69
bos@124 70 #$ name: manual.cat
bos@124 71
bos@124 72 cat myfile
bos@124 73
bos@124 74 #$ name: manual.merge
bos@124 75
bos@124 76 hg merge
bos@124 77 hg commit -m 'merged backout with previous tip'
bos@124 78 cat myfile
bos@124 79
bos@124 80 #$ name:
bos@124 81
bos@124 82 rm $HGMERGE