OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 set -e |
| 4 |
| 5 . ./test-lib.sh |
| 6 |
| 7 setup_initsvn |
| 8 setup_gitsvn_submodule |
| 9 |
| 10 ( |
| 11 set -e |
| 12 prev_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \ |
| 13 sed s/^.*:// | xargs` |
| 14 cd git-svn-submodule |
| 15 git config rietveld.server localhost:1 |
| 16 git checkout -q --track -b work |
| 17 echo "some work done" >> test |
| 18 git add test; git commit -q -m "work \ |
| 19 TBR=foo" |
| 20 |
| 21 git_diff=`git diff HEAD^ | sed -n '/^@@/,$p' | xargs` |
| 22 |
| 23 test_expect_success "dcommitted code" \ |
| 24 "$GIT_CL dcommit -f --bypass-hooks -m 'dcommit'" |
| 25 |
| 26 cd .. |
| 27 |
| 28 next_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \ |
| 29 sed s/^.*:// | xargs` |
| 30 |
| 31 test_expect_success "svn got new revision" \ |
| 32 "test $next_svn_revision = `expr $prev_svn_revision + 1`" |
| 33 |
| 34 svn_diff=`svn diff -c $next_svn_revision file://$PWD/svnrepo | \ |
| 35 sed -n '/^@@/,$p' | xargs` |
| 36 |
| 37 test_expect_success "svn diff is correct" \ |
| 38 "test \"$git_diff\" = \"$svn_diff\"" |
| 39 |
| 40 cd git-svn-submodule |
| 41 git svn fetch |
| 42 last_svn_rev=`git show refs/remotes/trunk | grep git-svn-id: | \ |
| 43 grep -o trunk@[0-9]* | xargs` |
| 44 |
| 45 test_expect_success "git svn fetch gets new svn revision" \ |
| 46 "test $last_svn_rev = trunk@$next_svn_revision" |
| 47 ) |
| 48 SUCCESS=$? |
| 49 |
| 50 #cleanup |
| 51 |
| 52 if [ $SUCCESS == 0 ]; then |
| 53 echo PASS |
| 54 fi |
OLD | NEW |