diff tests/test-convert-svn-source @ 5854:8b95f598097c

convert: separate trunk detection from branch layout detection In some subversion repositories, trunk is present but no branches are used. The current code is assuming that both trunk and branches must exist before adding trunk's head to the heads list. It's just better to separate the branch layout stuff from the trunk one.
author Edouard Gomez <ed.gomez@free.fr>
date Sat, 05 Jan 2008 01:51:21 +0100
parents de8311f7a31b
children 7c2921a60035
line wrap: on
line diff
--- a/tests/test-convert-svn-source	Sat Jan 12 20:49:07 2008 +0100
+++ b/tests/test-convert-svn-source	Sat Jan 05 01:51:21 2008 +0100
@@ -120,3 +120,58 @@
 hg glog --template '#rev# #desc|firstline# files: #files#\n'
 hg tags -q
 cd ..
+
+########################################
+
+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 ..
+
+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 ..