* [PATCH] git-svn: remove svnadmin dependency from the tests
@ 2007-01-01 5:49 Eric Wong
2007-01-01 5:49 ` [PATCH] git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINK Eric Wong
0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2007-01-01 5:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
We require the libraries now, so we can create repositories
using them (and save some executable load time while we're at
it).
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
t/lib-git-svn.sh | 39 +++++++++++++++++----------------------
1 files changed, 17 insertions(+), 22 deletions(-)
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index 99ada71..af42ccc 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -7,26 +7,10 @@ then
exit
fi
-perl -e 'use SVN::Core; $SVN::Core::VERSION gt "1.1.0" or die' >/dev/null 2>&1
-if test $? -ne 0
-then
- test_expect_success 'Perl SVN libraries not found, skipping test' :
- test_done
- exit
-fi
-
GIT_DIR=$PWD/.git
GIT_SVN_DIR=$GIT_DIR/svn/git-svn
SVN_TREE=$GIT_SVN_DIR/svn-tree
-svnadmin >/dev/null 2>&1
-if test $? -ne 1
-then
- test_expect_success 'skipping git-svn tests, svnadmin not found' :
- test_done
- exit
-fi
-
svn >/dev/null 2>&1
if test $? -ne 1
then
@@ -37,13 +21,24 @@ fi
svnrepo=$PWD/svnrepo
-set -e
-
-if svnadmin create --help | grep fs-type >/dev/null
+perl -w -e "
+use SVN::Core;
+use SVN::Repos;
+\$SVN::Core::VERSION gt '1.1.0' or exit(42);
+SVN::Repos::create('$svnrepo', undef, undef, undef,
+ { 'fs-config' => 'fsfs'});
+"
+x=$?
+if test $x -ne 0
then
- svnadmin create --fs-type fsfs "$svnrepo"
-else
- svnadmin create "$svnrepo"
+ if test $x -eq 42; then
+ err='Perl SVN libraries must be >= 1.1.0'
+ else
+ err='Perl SVN libraries not found or unusable, skipping test'
+ fi
+ test_expect_success "$err" :
+ test_done
+ exit
fi
svnrepo="file://$svnrepo"
--
1.5.0.rc0.g1ed48
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINK
2007-01-01 5:49 [PATCH] git-svn: remove svnadmin dependency from the tests Eric Wong
@ 2007-01-01 5:49 ` Eric Wong
2007-01-01 5:49 ` [PATCH] git-svn: t/t91??-*: optimize the tests a bit Eric Wong
0 siblings, 1 reply; 3+ messages in thread
From: Eric Wong @ 2007-01-01 5:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
We don't support the svn command-line client anymore; nor
do we support anything before SVN 1.1.0, so we can be certain
symlinks will be supported in the SVN repository.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
t/t9100-git-svn-basic.sh | 84 +++++++++++++++++++---------------------------
1 files changed, 35 insertions(+), 49 deletions(-)
diff --git a/t/t9100-git-svn-basic.sh b/t/t9100-git-svn-basic.sh
index c22fe47..040da92 100755
--- a/t/t9100-git-svn-basic.sh
+++ b/t/t9100-git-svn-basic.sh
@@ -24,10 +24,7 @@ test_expect_success \
mkdir import &&
cd import &&
echo foo > foo &&
- if test -z '$NO_SYMLINK'
- then
- ln -s foo foo.link
- fi
+ ln -s foo foo.link
mkdir -p dir/a/b/c/d/e &&
echo 'deep dir' > dir/a/b/c/d/e/file &&
mkdir bar &&
@@ -136,48 +133,43 @@ test_expect_success "$name" "
test -x '$SVN_TREE'/exec.sh"
-if test -z "$NO_SYMLINK"
-then
- name='executable file becomes a symlink to bar/zzz (file)'
-
- test_expect_success "$name" "
- rm exec.sh &&
- ln -s bar/zzz exec.sh &&
- git update-index exec.sh &&
- git commit -m '$name' &&
- git-svn set-tree --find-copies-harder --rmdir \
- remotes/git-svn..mybranch5 &&
- svn up '$SVN_TREE' &&
- test -L '$SVN_TREE'/exec.sh"
+name='executable file becomes a symlink to bar/zzz (file)'
+test_expect_success "$name" "
+ rm exec.sh &&
+ ln -s bar/zzz exec.sh &&
+ git update-index exec.sh &&
+ git commit -m '$name' &&
+ git-svn set-tree --find-copies-harder --rmdir \
+ remotes/git-svn..mybranch5 &&
+ svn up '$SVN_TREE' &&
+ test -L '$SVN_TREE'/exec.sh"
- name='new symlink is added to a file that was also just made executable'
+name='new symlink is added to a file that was also just made executable'
- test_expect_success "$name" "
- chmod +x bar/zzz &&
- ln -s bar/zzz exec-2.sh &&
- git update-index --add bar/zzz exec-2.sh &&
- git commit -m '$name' &&
- git-svn set-tree --find-copies-harder --rmdir \
- remotes/git-svn..mybranch5 &&
- svn up '$SVN_TREE' &&
- test -x '$SVN_TREE'/bar/zzz &&
- test -L '$SVN_TREE'/exec-2.sh"
-
- name='modify a symlink to become a file'
- test_expect_success "$name" "
- echo git help > help || true &&
- rm exec-2.sh &&
- cp help exec-2.sh &&
- git update-index exec-2.sh &&
- git commit -m '$name' &&
- git-svn set-tree --find-copies-harder --rmdir \
- remotes/git-svn..mybranch5 &&
- svn up '$SVN_TREE' &&
- test -f '$SVN_TREE'/exec-2.sh &&
- test ! -L '$SVN_TREE'/exec-2.sh &&
- diff -u help $SVN_TREE/exec-2.sh"
-fi
+test_expect_success "$name" "
+ chmod +x bar/zzz &&
+ ln -s bar/zzz exec-2.sh &&
+ git update-index --add bar/zzz exec-2.sh &&
+ git commit -m '$name' &&
+ git-svn set-tree --find-copies-harder --rmdir \
+ remotes/git-svn..mybranch5 &&
+ svn up '$SVN_TREE' &&
+ test -x '$SVN_TREE'/bar/zzz &&
+ test -L '$SVN_TREE'/exec-2.sh"
+name='modify a symlink to become a file'
+test_expect_success "$name" "
+ echo git help > help || true &&
+ rm exec-2.sh &&
+ cp help exec-2.sh &&
+ git update-index exec-2.sh &&
+ git commit -m '$name' &&
+ git-svn set-tree --find-copies-harder --rmdir \
+ remotes/git-svn..mybranch5 &&
+ svn up '$SVN_TREE' &&
+ test -f '$SVN_TREE'/exec-2.sh &&
+ test ! -L '$SVN_TREE'/exec-2.sh &&
+ diff -u help $SVN_TREE/exec-2.sh"
if test "$have_utf8" = t
then
@@ -203,12 +195,6 @@ test_expect_success "$name" \
git-rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
diff -u a b"
-if test -n "$NO_SYMLINK"
-then
- test_done
- exit 0
-fi
-
name='check imported tree checksums expected tree checksums'
rm -f expected
if test "$have_utf8" = t
--
1.5.0.rc0.g1ed48
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] git-svn: t/t91??-*: optimize the tests a bit
2007-01-01 5:49 ` [PATCH] git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINK Eric Wong
@ 2007-01-01 5:49 ` Eric Wong
0 siblings, 0 replies; 3+ messages in thread
From: Eric Wong @ 2007-01-01 5:49 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Eric Wong
This removes some unnecessary 'svn up' calls throughout
t9103-git-svn-graft-branches.sh:
* removed an 'svn log' call that was leftover from debugging
* removed multiple git-svn calls with a multi-init / multi-fetch
combination (which weren't tested before, either)
* replaced `rev-list ... | head -n1` with `rev-parse ...`
(not sure what I was thinking when I wrote that)
All this saves about 9 seconds from a test run
(53s -> 44s for 'make t91*') on my 1.3GHz Athlon
Signed-off-by: Eric Wong <normalperson@yhbt.net>
---
t/t9101-git-svn-props.sh | 11 +++--------
t/t9103-git-svn-graft-branches.sh | 14 ++++----------
t/t9104-git-svn-follow-parent.sh | 1 -
3 files changed, 7 insertions(+), 19 deletions(-)
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index 5543b07..46fcec5 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -57,13 +57,10 @@ test_expect_success 'setup some commits to svn' \
'cd test_wc &&
echo Greetings >> kw.c &&
svn commit -m "Not yet an Id" &&
- svn up &&
echo Hello world >> kw.c &&
svn commit -m "Modified file, but still not yet an Id" &&
- svn up &&
svn propset svn:keywords Id kw.c &&
- svn commit -m "Propset Id" &&
- svn up &&
+ svn commit -m "Propset Id"
cd ..'
test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
@@ -86,8 +83,7 @@ test_expect_success "propset CR on crlf files" \
svn propset svn:eol-style CR empty &&
svn propset svn:eol-style CR crlf &&
svn propset svn:eol-style CR ne_crlf &&
- svn commit -m "propset CR on crlf files" &&
- svn up &&
+ svn commit -m "propset CR on crlf files"
cd ..'
test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
@@ -111,8 +107,7 @@ cd test_wc
svn propset svn:eol-style CRLF ne_cr &&
svn propset svn:keywords Id cr &&
svn propset svn:keywords Id ne_cr &&
- svn commit -m "propset CRLF on cr files" &&
- svn up'
+ svn commit -m "propset CRLF on cr files"'
cd ..
test_expect_success 'fetch and pull latest from svn' \
'git-svn fetch && git pull . remotes/git-svn'
diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh
index 293b98f..b5f7677 100755
--- a/t/t9103-git-svn-graft-branches.sh
+++ b/t/t9103-git-svn-graft-branches.sh
@@ -16,25 +16,19 @@ test_expect_success 'initialize repo' "
cd wc &&
echo feedme >> branches/a/readme &&
svn commit -m hungry &&
- svn up &&
cd trunk &&
svn merge -r3:4 $svnrepo/branches/a &&
svn commit -m 'merge with a' &&
cd ../.. &&
- svn log -v $svnrepo &&
- git-svn init -i trunk $svnrepo/trunk &&
- git-svn init -i a $svnrepo/branches/a &&
- git-svn init -i tags/a $svnrepo/tags/a &&
- git-svn fetch -i tags/a &&
- git-svn fetch -i a &&
- git-svn fetch -i trunk
+ git-svn multi-init $svnrepo -T trunk -b branches -t tags &&
+ git-svn multi-fetch
"
r1=`git-rev-list remotes/trunk | tail -n1`
r2=`git-rev-list remotes/tags/a | tail -n1`
r3=`git-rev-list remotes/a | tail -n1`
-r4=`git-rev-list remotes/a | head -n1`
-r5=`git-rev-list remotes/trunk | head -n1`
+r4=`git-rev-parse remotes/a`
+r5=`git-rev-parse remotes/trunk`
test_expect_success 'test graft-branches regexes and copies' "
test -n "$r1" &&
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 8d2e2fe..400c21c 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -17,7 +17,6 @@ test_expect_success 'initialize repo' "
cd wc &&
echo world >> trunk/readme &&
svn commit -m 'another commit' &&
- svn up &&
svn mv -m 'rename to thunk' trunk thunk &&
svn up &&
echo goodbye >> thunk/readme &&
--
1.5.0.rc0.g1ed48
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-01-01 5:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-01 5:49 [PATCH] git-svn: remove svnadmin dependency from the tests Eric Wong
2007-01-01 5:49 ` [PATCH] git-svn: t/t9100-git-svn-basic: remove old check for NO_SYMLINK Eric Wong
2007-01-01 5:49 ` [PATCH] git-svn: t/t91??-*: optimize the tests a bit Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).