view en/examples/backout @ 807:7226e5e750a6

Clean up chapter 8, and add content
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 21 Apr 2009 23:49:27 -0700
parents 5fc4a45c069f
children
line wrap: on
line source

#!/bin/bash

# We have to fake the merges here, because they cause conflicts with
# three-way command-line merge, and kdiff3 may not be available.

export HGMERGE=$(mktemp)
echo '#!/bin/sh' >> $HGMERGE
echo 'echo first change > "$1"' >> $HGMERGE
echo 'echo third change >> "$1"' >> $HGMERGE
chmod 700 $HGMERGE

#$ name: init

hg init myrepo
cd myrepo
echo first change >> myfile
hg add myfile
hg commit -m 'first change'
echo second change >> myfile
hg commit -m 'second change'

#$ name: simple

hg backout -m 'back out second change' tip
cat myfile

#$ name: simple.log
#$ ignore: \s+200[78]-.*

hg log --style compact

#$ name: non-tip.clone

cd ..
hg clone -r1 myrepo non-tip-repo
cd non-tip-repo

#$ name: non-tip.backout

echo third change >> myfile
hg commit -m 'third change'
hg backout --merge -m 'back out second change' 1

#$ name: non-tip.cat
cat myfile

#$ name: manual.clone

cd ..
hg clone -r1 myrepo newrepo
cd newrepo

#$ name: manual.backout

echo third change >> myfile
hg commit -m 'third change'
hg backout -m 'back out second change' 1

#$ name: manual.log

hg log --style compact

#$ name: manual.parents

hg parents

#$ name: manual.heads

hg heads

#$ name:

echo 'first change' > myfile

#$ name: manual.cat

cat myfile

#$ name: manual.merge

hg merge
hg commit -m 'merged backout with previous tip'
cat myfile

#$ name:

rm $HGMERGE