summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMichael Spang <mspang@uwaterloo.ca>2007-02-13 00:33:37 (GMT)
committerJunio C Hamano <junkio@cox.net>2007-02-13 06:17:04 (GMT)
commit7b3fab877d468a51bab6050385ab701697301c62 (patch)
tree888945075844874a43d42197d04c5950d0c94b96 /t
parentccf5aa8dd3bc64837a4ca391d0b8bd0e3e481b7e (diff)
downloadgit-7b3fab877d468a51bab6050385ab701697301c62.zip
git-7b3fab877d468a51bab6050385ab701697301c62.tar.gz
git-7b3fab877d468a51bab6050385ab701697301c62.tar.bz2
Work around Subversion race in git-svn tests.
Some of the git-svn tests can fail on fast machines due to a race in Subversion: if a file is modified in the same second it was checked out (or in for that matter), Subversion will not consider it modified. This works around the problem by increasing the timestamp by one second before each commit. [jc: with "touch -r -d" replacement from Eric] Acked-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Michael Spang <mspang@uwaterloo.ca> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 't')
-rw-r--r--t/lib-git-svn.sh3
-rwxr-xr-xt/t9101-git-svn-props.sh7
-rwxr-xr-xt/t9103-git-svn-graft-branches.sh1
-rwxr-xr-xt/t9104-git-svn-follow-parent.sh2
-rwxr-xr-xt/t9106-git-svn-commit-diff-clobber.sh2
5 files changed, 13 insertions, 2 deletions
diff --git a/t/lib-git-svn.sh b/t/lib-git-svn.sh
index bb1d7b8..67d08cf 100644
--- a/t/lib-git-svn.sh
+++ b/t/lib-git-svn.sh
@@ -45,3 +45,6 @@ fi
svnrepo="file://$svnrepo"
+poke() {
+ perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' "$1"
+}
diff --git a/t/t9101-git-svn-props.sh b/t/t9101-git-svn-props.sh
index a2c4dc3..e8133d8 100755
--- a/t/t9101-git-svn-props.sh
+++ b/t/t9101-git-svn-props.sh
@@ -56,11 +56,14 @@ test_expect_success 'checkout working copy from svn' "svn co $svnrepo test_wc"
test_expect_success 'setup some commits to svn' \
'cd test_wc &&
echo Greetings >> kw.c &&
+ poke kw.c &&
svn commit -m "Not yet an Id" &&
echo Hello world >> kw.c &&
+ poke kw.c &&
svn commit -m "Modified file, but still not yet an Id" &&
svn propset svn:keywords Id kw.c &&
- svn commit -m "Propset Id"
+ poke kw.c &&
+ svn commit -m "Propset Id" &&
cd ..'
test_expect_success 'initialize git-svn' "git-svn init $svnrepo"
@@ -83,7 +86,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 commit -m "propset CR on crlf files" &&
cd ..'
test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
diff --git a/t/t9103-git-svn-graft-branches.sh b/t/t9103-git-svn-graft-branches.sh
index 4e55778..183ae3b 100755
--- a/t/t9103-git-svn-graft-branches.sh
+++ b/t/t9103-git-svn-graft-branches.sh
@@ -16,6 +16,7 @@ test_expect_success 'initialize repo' "
svn co $svnrepo wc &&
cd wc &&
echo feedme >> branches/a/readme &&
+ poke branches/a/readme &&
svn commit -m hungry &&
cd trunk &&
svn merge -r3:4 $svnrepo/branches/a &&
diff --git a/t/t9104-git-svn-follow-parent.sh b/t/t9104-git-svn-follow-parent.sh
index 8d2e2fe..405b555 100755
--- a/t/t9104-git-svn-follow-parent.sh
+++ b/t/t9104-git-svn-follow-parent.sh
@@ -16,11 +16,13 @@ test_expect_success 'initialize repo' "
svn co $svnrepo wc &&
cd wc &&
echo world >> trunk/readme &&
+ poke trunk/readme &&
svn commit -m 'another commit' &&
svn up &&
svn mv -m 'rename to thunk' trunk thunk &&
svn up &&
echo goodbye >> thunk/readme &&
+ poke thunk/readme &&
svn commit -m 'bye now' &&
cd ..
"
diff --git a/t/t9106-git-svn-commit-diff-clobber.sh b/t/t9106-git-svn-commit-diff-clobber.sh
index 59b6425..6f132f2 100755
--- a/t/t9106-git-svn-commit-diff-clobber.sh
+++ b/t/t9106-git-svn-commit-diff-clobber.sh
@@ -18,6 +18,7 @@ test_expect_success 'commit change from svn side' "
svn co $svnrepo t.svn &&
cd t.svn &&
echo second line from svn >> file &&
+ poke file &&
svn commit -m 'second line from svn' &&
cd .. &&
rm -rf t.svn
@@ -45,6 +46,7 @@ test_expect_failure 'dcommit fails to commit because of conflict' "
svn co $svnrepo t.svn &&
cd t.svn &&
echo fourth line from svn >> file &&
+ poke file &&
svn commit -m 'fourth line from svn' &&
cd .. &&
rm -rf t.svn &&