1. Stefan Saasen
  2. git

Commits

Michael Spang  committed 7b3fab8

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>

  • Participants
  • Parent commits ccf5aa8
  • Branches master

Comments (0)

Files changed (5)

File t/lib-git-svn.sh

View file
  • Ignore whitespace
 svnrepo="file://$svnrepo"
 
 
+poke() {
+	perl -e '@x = stat($ARGV[0]); utime($x[8], $x[9] + 1, $ARGV[0])' "$1"
+}

File t/t9101-git-svn-props.sh

View file
  • Ignore whitespace
 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"
 		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' \

File t/t9103-git-svn-graft-branches.sh

View file
  • Ignore whitespace
 	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 &&

File t/t9104-git-svn-follow-parent.sh

View file
  • Ignore whitespace
 	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 ..
 	"

File t/t9106-git-svn-commit-diff-clobber.sh

View file
  • Ignore whitespace
 	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
 	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 &&