summaryrefslogtreecommitdiff
path: root/tests/test-convert-svn-source.t
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test-convert-svn-source.t')
-rw-r--r--tests/test-convert-svn-source.t62
1 files changed, 24 insertions, 38 deletions
diff --git a/tests/test-convert-svn-source.t b/tests/test-convert-svn-source.t
index 544f3a5..a97adeb 100644
--- a/tests/test-convert-svn-source.t
+++ b/tests/test-convert-svn-source.t
@@ -1,6 +1,10 @@
$ "$TESTDIR/hghave" svn svn-bindings || exit 80
+ $ fixpath()
+ > {
+ > tr '\\' /
+ > }
$ cat >> $HGRCPATH <<EOF
> [extensions]
> convert =
@@ -10,12 +14,14 @@
> EOF
$ svnadmin create svn-repo
- $ SVNREPOPATH=`pwd`/svn-repo
-#if windows
- $ SVNREPOURL=file:///`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
-#else
- $ SVNREPOURL=file://`python -c "import urllib, sys; sys.stdout.write(urllib.quote(sys.argv[1]))" "$SVNREPOPATH"`
-#endif
+ $ svnpath=`pwd | fixpath`
+
+
+ $ expr "$svnpath" : "\/" > /dev/null
+ > if [ $? -ne 0 ]; then
+ > svnpath="/$svnpath"
+ > fi
+ > svnurl="file://$svnpath/svn-repo"
Now test that it works with trunk/tags layout, but no branches yet.
@@ -27,15 +33,16 @@ Initial svn import
$ mkdir tags
$ cd ..
- $ svn import -m "init projB" projB "$SVNREPOURL/proj%20B" | sort
+ $ svnurl="file://$svnpath/svn-repo/proj%20B"
+ $ svn import -m "init projB" projB "$svnurl" | fixpath
+ Adding projB/mytrunk
+ Adding projB/tags
- Adding projB/mytrunk (glob)
- Adding projB/tags (glob)
Committed revision 1.
Update svn repository
- $ svn co "$SVNREPOURL/proj%20B/mytrunk" B
+ $ svn co "$svnurl"/mytrunk B | fixpath
Checked out revision 1.
$ cd B
$ echo hello > 'letter .txt'
@@ -52,7 +59,7 @@ Update svn repository
Transmitting file data .
Committed revision 3.
- $ svn copy -m "tag v0.1" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.1"
+ $ svn copy -m "tag v0.1" "$svnurl"/mytrunk "$svnurl"/tags/v0.1
Committed revision 4.
@@ -65,7 +72,7 @@ Update svn repository
Convert to hg once
- $ hg convert "$SVNREPOURL/proj%20B" B-hg
+ $ hg convert "$svnurl" B-hg
initializing destination B-hg repository
scanning source...
sorting...
@@ -89,7 +96,7 @@ Update svn repository again
Transmitting file data ..
Committed revision 6.
- $ svn copy -m "tag v0.2" "$SVNREPOURL/proj%20B/mytrunk" "$SVNREPOURL/proj%20B/tags/v0.2"
+ $ svn copy -m "tag v0.2" "$svnurl"/mytrunk "$svnurl"/tags/v0.2
Committed revision 7.
@@ -100,7 +107,7 @@ Update svn repository again
Committed revision 8.
$ cd ..
- $ hg convert -s svn "$SVNREPOURL/proj%20B/non-existent-path" dest
+ $ hg convert -s svn "$svnurl/non-existent-path" dest
initializing destination dest repository
abort: no revision found in module /proj B/non-existent-path
[255]
@@ -109,7 +116,7 @@ Update svn repository again
Test incremental conversion
- $ hg convert "$SVNREPOURL/proj%20B" B-hg
+ $ hg convert "$svnurl" B-hg
scanning source...
sorting...
converting...
@@ -143,7 +150,7 @@ Test incremental conversion
Test filemap
$ echo 'include letter2.txt' > filemap
- $ hg convert --filemap filemap "$SVNREPOURL/proj%20B/mytrunk" fmap
+ $ hg convert --filemap filemap "$svnurl"/mytrunk fmap
initializing destination fmap repository
scanning source...
sorting...
@@ -163,7 +170,7 @@ Test filemap
Test stop revision
- $ hg convert --rev 1 "$SVNREPOURL/proj%20B/mytrunk" stoprev
+ $ hg convert --rev 1 "$svnurl"/mytrunk stoprev
initializing destination stoprev repository
scanning source...
sorting...
@@ -180,24 +187,3 @@ This is also the only place testing more than one extra field in a revision.
extra: branch=default
extra: convert_revision=svn:........-....-....-....-............/proj B/mytrunk@1 (re)
$ cd ..
-
-Test converting empty heads (issue3347)
-
- $ svnadmin create svn-empty
- $ svnadmin load -q svn-empty < "$TESTDIR/svn/empty.svndump"
- $ hg --config convert.svn.trunk= convert svn-empty
- assuming destination svn-empty-hg
- initializing destination svn-empty-hg repository
- scanning source...
- sorting...
- converting...
- 1 init projA
- 0 adddir
- $ hg --config convert.svn.trunk= convert "$SVNREPOURL/../svn-empty/trunk"
- assuming destination trunk-hg
- initializing destination trunk-hg repository
- scanning source...
- sorting...
- converting...
- 1 init projA
- 0 adddir