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