view tests/test-convert-cvs-branch @ 7654:816b708f23af

store all heads of a branch in the branch cache All heads of branches will be stored in a new cache file 'branchheads.cache' within the .hg directory. The old 'branch.cache' file from older versions will be ignored. The new cache contents are formatted line-by-line as '{node} {branchtag}\n'. This is the same as the previous format. Now, every head is recorded in an oldest -> tipmost order. The localrepo.branchheads function is reworked to use the data from the cache.
author John Mulligan <phlogistonjohn@asynchrono.us>
date Wed, 14 Jan 2009 21:47:38 -0500
parents 8f0305874701
children 18048153fd4e
line wrap: on
line source

#!/bin/sh

# This is http://www.selenic.com/mercurial/bts/issue1148

"$TESTDIR/hghave" cvs || exit 80

cvscall()
{
    cvs -f "$@"
}

echo "[extensions]" >> $HGRCPATH
echo "convert = " >> $HGRCPATH
echo "graphlog = " >> $HGRCPATH
echo "[convert]" >> $HGRCPATH
echo "cvsps=builtin" >> $HGRCPATH

echo % create cvs repository
mkdir cvsrepo
cd cvsrepo
export CVSROOT=`pwd`
export CVS_OPTIONS=-f
cd ..

cvscall -q -d "$CVSROOT" init

echo % Create a new project

mkdir src
cd src
echo "1" > a
echo "1" > b
cvscall import -m "init" src v0 r0 | sort
cd ..
cvscall co src
cd src

echo % Branch the project

cvscall tag -b BRANCH
cvscall up -r BRANCH

echo % Modify file a, then b, then a 

echo "2" > a
cvscall ci -m "mod a" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'

echo "2" > b
cvscall ci -m "mod b" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'

echo "3" > a
cvscall ci -m "mod a again" | grep '<--' | sed -e 's:.*src/\(.*\),v.*:checking in src/\1,v:g'

echo % Convert

cd ..
hg convert src | sed -e 's/connecting to.*cvsrepo/connecting to cvsrepo/g'

echo % Check the result

hg -R src-hg glog --template '#rev# (#branches#) #desc# files: #files#\n'