hgbook

annotate ja/examples/backout @ 862:ad6d3f5245e7

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