hgbook
diff 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 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/en/examples/backout Tue Dec 26 13:08:20 2006 -0800 1.3 @@ -0,0 +1,82 @@ 1.4 +#!/bin/bash 1.5 + 1.6 +# We have to fake the merges here, because they cause conflicts with 1.7 +# three-way command-line merge, and kdiff3 may not be available. 1.8 + 1.9 +export HGMERGE=$(mktemp) 1.10 +echo '#!/bin/sh' >> $HGMERGE 1.11 +echo 'echo first change > "$1"' >> $HGMERGE 1.12 +echo 'echo third change > "$1"' >> $HGMERGE 1.13 +chmod 700 $HGMERGE 1.14 + 1.15 +#$ name: init 1.16 + 1.17 +hg init myrepo 1.18 +cd myrepo 1.19 +echo first change >> myfile 1.20 +hg add myfile 1.21 +hg commit -m 'first change' 1.22 +echo second change >> myfile 1.23 +hg commit -m 'second change' 1.24 + 1.25 +#$ name: simple 1.26 + 1.27 +hg backout -m 'back out second change' tip 1.28 +cat myfile 1.29 + 1.30 +#$ name: simple.log 1.31 + 1.32 +hg log --style compact 1.33 + 1.34 +#$ name: non-tip.clone 1.35 + 1.36 +cd .. 1.37 +hg clone -r1 myrepo non-tip-repo 1.38 +cd non-tip-repo 1.39 + 1.40 +#$ name: non-tip.backout 1.41 + 1.42 +echo third change >> myfile 1.43 +hg commit -m 'third change' 1.44 +hg backout --merge -m 'back out second change' 1 1.45 + 1.46 +#$ name: non-tip.cat 1.47 +cat myfile 1.48 + 1.49 +#$ name: manual.clone 1.50 + 1.51 +cd .. 1.52 +hg clone -r1 myrepo newrepo 1.53 +cd newrepo 1.54 + 1.55 +#$ name: manual.backout 1.56 + 1.57 +echo third change >> myfile 1.58 +hg commit -m 'third change' 1.59 +hg backout -m 'back out second change' 1 1.60 + 1.61 +#$ name: manual.log 1.62 + 1.63 +hg log --style compact 1.64 + 1.65 +#$ name: manual.parents 1.66 + 1.67 +hg parents 1.68 + 1.69 +#$ name: manual.heads 1.70 + 1.71 +hg heads 1.72 + 1.73 +#$ name: manual.cat 1.74 + 1.75 +cat myfile 1.76 + 1.77 +#$ name: manual.merge 1.78 + 1.79 +hg merge 1.80 +hg commit -m 'merged backout with previous tip' 1.81 +cat myfile 1.82 + 1.83 +#$ name: 1.84 + 1.85 +rm $HGMERGE