##// END OF EJS Templates
merge with hg-stable
merge with hg-stable

File last commit:

r6401:635c57cf default
r6438:a60b711c merge default
Show More
test-convert-svn-source
89 lines | 1.9 KiB | text/plain | TextLexer
/ tests / test-convert-svn-source
Bryan O'Sullivan
convert: add support for Subversion as a sink
r5513 #!/bin/sh
"$TESTDIR/hghave" svn svn-bindings || exit 80
fix_path()
{
tr '\\' /
}
echo "[extensions]" >> $HGRCPATH
echo "convert = " >> $HGRCPATH
Patrick Mezard
test-convert-svn-source: remove redundant tests
r6401 echo 'hgext.graphlog =' >> $HGRCPATH
Bryan O'Sullivan
convert: add support for Subversion as a sink
r5513
svnadmin create svn-repo
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
Edouard Gomez
convert: separate trunk detection from branch layout detection...
r5854 echo "# now tests that it works with trunk/tags layout, but no branches yet"
echo
echo % initial svn import
mkdir projB
cd projB
mkdir trunk
mkdir tags
cd ..
svnurl=file://$svnpath/svn-repo/projB
svn import -m "init projB" projB $svnurl | fix_path
echo % update svn repository
svn co $svnurl/trunk B | fix_path
cd B
echo hello > letter.txt
svn add letter.txt
svn ci -m hello
echo world >> letter.txt
svn ci -m world
svn copy -m "tag v0.1" $svnurl/trunk $svnurl/tags/v0.1
echo 'nice day today!' >> letter.txt
svn ci -m "nice day"
cd ..
echo % convert to hg once
hg convert $svnurl B-hg
echo % update svn repository again
cd B
echo "see second letter" >> letter.txt
echo "nice to meet you" > letter2.txt
svn add letter2.txt
svn ci -m "second letter"
svn copy -m "tag v0.2" $svnurl/trunk $svnurl/tags/v0.2
echo "blah-blah-blah" >> letter2.txt
svn ci -m "work in progress"
cd ..
Patrick Mezard
test-convert-svn-source: remove redundant tests
r6401 ########################################
Edouard Gomez
convert: separate trunk detection from branch layout detection...
r5854 echo % test incremental conversion
hg convert $svnurl B-hg
cd B-hg
hg glog --template '#rev# #desc|firstline# files: #files#\n'
hg tags -q
cd ..
Patrick Mezard
test-convert-svn-source: remove redundant tests
r6401
echo % test filemap
echo 'include letter2.txt' > filemap
hg convert --filemap filemap $svnurl/trunk fmap
hg glog -R fmap --template '#rev# #desc|firstline# files: #files#\n'
echo % test stop revision
hg convert --rev 1 $svnurl/trunk stoprev
# Check convert_revision extra-records.
# This is also the only place testing more than one extra field
# in a revision.
hg --cwd stoprev tip --debug | grep extra | sed 's/=.*/=/'