tests/test-convert-cvs-branch
author Edouard Gomez <ed.gomez@free.fr>
Sun, 04 Jan 2009 02:36:48 +0100
changeset 7583 77fec2d270ae
parent 7465 8f0305874701
child 7812 18048153fd4e
permissions -rwxr-xr-x
convert/gnuarch: parse continuation-of revisions in gnuarch source In GNU Arch, continuation-of was often used for: - tagging revisions - continue working on a project in a new archive, because arch was scaling poorly in revision numbers (cat-logs were slow to be parsed and scanned through) - very similar to the previous point, fork his own branch of a project. Parsing this header information will allow to 'follow' new history because it often hints at older/forked/personal revision trees. This patch however just implements the parsing of the continuation-of header. A followup patch will implement the proper use of this new information.

#!/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'