#!/bin/sh
# demonstrate 'hg clone' branch bug in Mercurial-1.0.1. 
# No matter what branch is requested during clone the working directory 
# of the clone is set to 'default' branch.

rm -rf   /tmp/HGtmp
mkdir -p /tmp/HGtmp/incoming
cd /tmp/HGtmp/incoming
hg init
touch A B
hg add A
hg ci -m "branch=default. Added A"
hg branch
hg branches
hg add B
hg branch foo
hg ci -m "branch=foo. Added B"
hg branch
hg branches
cd /tmp/HGtmp
echo "**** cloning repo's branch foo"
echo "**** hg clone --rev=foo  incoming ws"
hg clone --rev=foo  incoming ws
cd ws
hg par
hg branches
echo "**** The working branch of the clone is"
hg branch
echo "**** instead of 'foo'"

#EoF
