view tests/test-convert-svn @ 5374:e710874247d1

convert: allow the converter_source to say "skip this revision" If getchanges returns a string, it's assumed to be the id of an already converted revision. We map the current revision to the same revision this converted revision was mapped to. To allow skipping a root revision, getchanges can return the special string 'hg-convert-skipped-revision' (a.k.a. common.SKIPREV), which hopefully won't clash with any real id. The converter_source is responsible for rewriting the parents of the commit objects to make sure the revision graph makes sense.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Thu, 04 Oct 2007 23:21:37 -0300
parents 4287590a63af
children d7d395fb7cd5
line wrap: on
line source

#!/bin/sh

"$TESTDIR/hghave" svn svn-bindings || exit 80

fix_path()
{
    tr '\\' /
}

echo "[extensions]" >> $HGRCPATH
echo "convert = " >> $HGRCPATH

svnadmin create svn-repo

echo % initial svn import
mkdir t
cd t
echo a > a
cd ..

svnpath=`pwd | fix_path`
# SVN wants all paths to start with a slash. Unfortunately,
# Windows ones don't. Handle that.
expr $svnpath : "\/" > /dev/null
if [ $? -ne 0 ]; then
    svnpath='/'$svnpath
fi

svnurl=file://$svnpath/svn-repo/trunk
svn import -m init t $svnurl | fix_path

echo % update svn repository
svn co $svnurl t2 | fix_path
cd t2
echo b >> a
echo b > b
svn add b
svn ci -m changea
cd ..

echo % convert to hg once
hg convert $svnurl

echo % update svn repository again
cd t2
echo c >> a
echo c >> b
svn ci -m changeb
cd ..

echo % test incremental conversion
hg convert $svnurl