OLD | NEW |
1 #!/usr/bin/env bash | 1 #!/usr/bin/env bash |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 set -e | 7 set -e |
| 8 SCRIPT_DIR=$(cd $(dirname "$BASH_SOURCE") && pwd) |
| 9 cd ${SCRIPT_DIR} |
8 | 10 |
9 . ./test-lib.sh | 11 . ./test-lib.sh |
10 | 12 |
11 setup_initsvn | 13 setup_initsvn |
12 setup_gitsvn_submodule | 14 setup_gitsvn_submodule |
13 | 15 |
14 ( | 16 ( |
15 set -e | 17 set -e |
16 prev_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \ | 18 prev_svn_revision=`svn info file://$PWD/svnrepo | grep ^Revision | \ |
17 sed s/^.*:// | xargs` | 19 sed s/^.*:// | xargs` |
(...skipping 18 matching lines...) Expand all Loading... |
36 "test $next_svn_revision = `expr $prev_svn_revision + 1`" | 38 "test $next_svn_revision = `expr $prev_svn_revision + 1`" |
37 | 39 |
38 svn_diff=`svn diff -c $next_svn_revision file://$PWD/svnrepo | \ | 40 svn_diff=`svn diff -c $next_svn_revision file://$PWD/svnrepo | \ |
39 sed -n '/^@@/,$p' | xargs` | 41 sed -n '/^@@/,$p' | xargs` |
40 | 42 |
41 test_expect_success "svn diff is correct" \ | 43 test_expect_success "svn diff is correct" \ |
42 "test \"$git_diff\" = \"$svn_diff\"" | 44 "test \"$git_diff\" = \"$svn_diff\"" |
43 | 45 |
44 cd git-svn-submodule | 46 cd git-svn-submodule |
45 git svn fetch | 47 git svn fetch |
46 last_svn_rev=`git show refs/remotes/trunk | grep git-svn-id: | \ | 48 last_svn_rev=`git show refs/remotes/origin/trunk | grep git-svn-id: | \ |
47 grep -o trunk@[0-9]* | xargs` | 49 grep -o trunk@[0-9]* | xargs` |
48 | 50 |
49 test_expect_success "git svn fetch gets new svn revision" \ | 51 test_expect_success "git svn fetch gets new svn revision" \ |
50 "test $last_svn_rev = trunk@$next_svn_revision" | 52 "test $last_svn_rev = trunk@$next_svn_revision" |
51 ) | 53 ) |
52 SUCCESS=$? | 54 SUCCESS=$? |
53 | 55 |
54 #cleanup | 56 #cleanup |
55 | 57 |
56 if [ $SUCCESS == 0 ]; then | 58 if [ $SUCCESS == 0 ]; then |
57 echo PASS | 59 echo PASS |
58 fi | 60 fi |
OLD | NEW |