diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2011-10-01 20:49:36 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-27 13:27:51 +0000 |
commit | 921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch) | |
tree | 3c4a89176ea67fe4c7bf7b375488361a823c95fa /tests/test-convert-hg-svn.t | |
parent | 9039c805b0a7e36220101323f82735f08a104b37 (diff) | |
download | mercurial-tarball-master.tar.gz |
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'tests/test-convert-hg-svn.t')
-rw-r--r-- | tests/test-convert-hg-svn.t | 49 |
1 files changed, 26 insertions, 23 deletions
diff --git a/tests/test-convert-hg-svn.t b/tests/test-convert-hg-svn.t index d7ebedd..ef002a7 100644 --- a/tests/test-convert-hg-svn.t +++ b/tests/test-convert-hg-svn.t @@ -1,18 +1,15 @@ $ "$TESTDIR/hghave" svn svn-bindings || exit 80 + $ fix_path() + > { + > tr '\\' / + > } $ echo "[extensions]" >> $HGRCPATH $ echo "convert = " >> $HGRCPATH $ echo "mq = " >> $HGRCPATH - - $ 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 - - $ svnadmin create "$SVNREPOPATH" - $ cat > "$SVNREPOPATH"/hooks/pre-revprop-change <<EOF + $ svnpath=`pwd | fix_path`/svn-repo + $ svnadmin create "$svnpath" + $ cat > "$svnpath"/hooks/pre-revprop-change <<EOF > #!/bin/sh > > REPOS="$1" @@ -28,10 +25,16 @@ > echo "Changing prohibited revision property" >&2 > exit 1 > EOF - $ chmod +x "$SVNREPOPATH"/hooks/pre-revprop-change - $ svn co "$SVNREPOURL" "$SVNREPOPATH"-wc + $ chmod +x "$svnpath"/hooks/pre-revprop-change + $ + $ # SVN wants all paths to start with a slash. Unfortunately, + $ # Windows ones don't. Handle that. + $ svnurl="$svnpath" + $ expr "$svnurl" : "\/" > /dev/null || svnurl="/$svnurl" + $ svnurl="file://$svnurl" + $ svn co "$svnurl" "$svnpath"-wc Checked out revision 0. - $ cd "$SVNREPOPATH"-wc + $ cd "$svnpath"-wc $ echo a > a $ svn add a A a @@ -43,33 +46,33 @@ initial roundtrip - $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg | grep -v initializing + $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg | grep -v initializing scanning source... sorting... converting... 0 added a - $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc + $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc scanning source... sorting... converting... second roundtrip should do nothing - $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg + $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg scanning source... sorting... converting... - $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc + $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc scanning source... sorting... converting... new hg rev - $ hg clone "$SVNREPOPATH"-hg "$SVNREPOPATH"-work + $ hg clone "$svnpath"-hg "$svnpath"-work updating to branch default 1 files updated, 0 files merged, 0 files removed, 0 files unresolved - $ cd "$SVNREPOPATH"-work + $ cd "$svnpath"-work $ echo b > b $ hg add b $ hg ci -mb @@ -82,8 +85,8 @@ adding an empty revision echo hg to svn - $ hg --cwd "$SVNREPOPATH"-hg pull -q "$SVNREPOPATH"-work - $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc + $ hg --cwd "$svnpath"-hg pull -q "$svnpath"-work + $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc scanning source... sorting... converting... @@ -92,14 +95,14 @@ echo hg to svn svn back to hg should do nothing - $ hg convert -s svn -d hg "$SVNREPOPATH"-wc "$SVNREPOPATH"-hg + $ hg convert -s svn -d hg "$svnpath"-wc "$svnpath"-hg scanning source... sorting... converting... hg back to svn should do nothing - $ hg convert -s hg -d svn "$SVNREPOPATH"-hg "$SVNREPOPATH"-wc + $ hg convert -s hg -d svn "$svnpath"-hg "$svnpath"-wc scanning source... sorting... converting... |