@matheusbsbs / matheus-bagliano / commits / 16805d3e59
Fork 0

t/t91XX-svn: start removing use of "git-" from these tests

Subversion tests use too many "git-foo" form, so I am converting them in two steps. This first step replaces literal strings "remotes/git-svn" and "git-svn-id" by introducing $remotes_git_svn and $git_svn_id constants defined as shell variables. This will reduce the number of false hits from "git grep". Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nanako Shiraishi committed Sep 8, 2008 at 19:02 UTC 16805d3e59250769f409480ca3cb739281bc906c
10 files changed +58 -55
t/lib-git-svn.sh
+3
@@ -1,5 +1,8 @@
1 . ./test-lib.sh
2
3 +remotes_git_svn=remotes/git""-svn
4 +git_svn_id=git""-svn-id
5 +
6 if test -n "$NO_SVN_TESTS"
7 then
8 test_expect_success 'skipping git-svn tests, NO_SVN_TESTS defined' :
t/t9100-git-svn-basic.sh
+19 -19
@@ -44,13 +44,13 @@ test_expect_success "checkout from svn" 'svn co "$svnrepo" "$SVN_TREE"'
44
45 name='try a deep --rmdir with a commit'
46 test_expect_success "$name" '
47 - git checkout -f -b mybranch remotes/git-svn &&
47 + git checkout -f -b mybranch ${remotes_git_svn} &&
48 mv dir/a/b/c/d/e/file dir/file &&
49 cp dir/file file &&
50 git update-index --add --remove dir/a/b/c/d/e/file dir/file file &&
51 git commit -m "$name" &&
52 git-svn set-tree --find-copies-harder --rmdir \
53 - remotes/git-svn..mybranch &&
53 + ${remotes_git_svn}..mybranch &&
54 svn up "$SVN_TREE" &&
55 test -d "$SVN_TREE"/dir && test ! -d "$SVN_TREE"/dir/a'
56
@@ -64,13 +64,13 @@ test_expect_success "$name" "
64 git update-index --add dir/file/file &&
65 git commit -m '$name' &&
66 test_must_fail git-svn set-tree --find-copies-harder --rmdir \
67 - remotes/git-svn..mybranch" || true
67 + ${remotes_git_svn}..mybranch" || true
68
69
70 name='detect node change from directory to file #1'
71 test_expect_success "$name" '
72 rm -rf dir "$GIT_DIR"/index &&
73 - git checkout -f -b mybranch2 remotes/git-svn &&
73 + git checkout -f -b mybranch2 ${remotes_git_svn} &&
74 mv bar/zzz zzz &&
75 rm -rf bar &&
76 mv zzz bar &&
@@ -78,13 +78,13 @@ test_expect_success "$name" '
78 git update-index --add -- bar &&
79 git commit -m "$name" &&
80 test_must_fail git-svn set-tree --find-copies-harder --rmdir \
81 - remotes/git-svn..mybranch2' || true
81 + ${remotes_git_svn}..mybranch2' || true
82
83
84 name='detect node change from file to directory #2'
85 test_expect_success "$name" '
86 rm -f "$GIT_DIR"/index &&
87 - git checkout -f -b mybranch3 remotes/git-svn &&
87 + git checkout -f -b mybranch3 ${remotes_git_svn} &&
88 rm bar/zzz &&
89 git update-index --remove bar/zzz &&
90 mkdir bar/zzz &&
@@ -92,13 +92,13 @@ test_expect_success "$name" '
92 git update-index --add bar/zzz/yyy &&
93 git commit -m "$name" &&
94 test_must_fail git-svn set-tree --find-copies-harder --rmdir \
95 - remotes/git-svn..mybranch3' || true
95 + ${remotes_git_svn}..mybranch3' || true
96
97
98 name='detect node change from directory to file #2'
99 test_expect_success "$name" '
100 rm -f "$GIT_DIR"/index &&
101 - git checkout -f -b mybranch4 remotes/git-svn &&
101 + git checkout -f -b mybranch4 ${remotes_git_svn} &&
102 rm -rf dir &&
103 git update-index --remove -- dir/file &&
104 touch dir &&
@@ -106,18 +106,18 @@ test_expect_success "$name" '
106 git update-index --add -- dir &&
107 git commit -m "$name" &&
108 test_must_fail git-svn set-tree --find-copies-harder --rmdir \
109 - remotes/git-svn..mybranch4' || true
109 + ${remotes_git_svn}..mybranch4' || true
110
111
112 name='remove executable bit from a file'
113 test_expect_success "$name" '
114 rm -f "$GIT_DIR"/index &&
115 - git checkout -f -b mybranch5 remotes/git-svn &&
115 + git checkout -f -b mybranch5 ${remotes_git_svn} &&
116 chmod -x exec.sh &&
117 git update-index exec.sh &&
118 git commit -m "$name" &&
119 git-svn set-tree --find-copies-harder --rmdir \
120 - remotes/git-svn..mybranch5 &&
120 + ${remotes_git_svn}..mybranch5 &&
121 svn up "$SVN_TREE" &&
122 test ! -x "$SVN_TREE"/exec.sh'
123
@@ -128,7 +128,7 @@ test_expect_success "$name" '
128 git update-index exec.sh &&
129 git commit -m "$name" &&
130 git-svn set-tree --find-copies-harder --rmdir \
131 - remotes/git-svn..mybranch5 &&
131 + ${remotes_git_svn}..mybranch5 &&
132 svn up "$SVN_TREE" &&
133 test -x "$SVN_TREE"/exec.sh'
134
@@ -140,7 +140,7 @@ test_expect_success "$name" '
140 git update-index exec.sh &&
141 git commit -m "$name" &&
142 git-svn set-tree --find-copies-harder --rmdir \
143 - remotes/git-svn..mybranch5 &&
143 + ${remotes_git_svn}..mybranch5 &&
144 svn up "$SVN_TREE" &&
145 test -L "$SVN_TREE"/exec.sh'
146
@@ -152,7 +152,7 @@ test_expect_success "$name" '
152 git update-index --add bar/zzz exec-2.sh &&
153 git commit -m "$name" &&
154 git-svn set-tree --find-copies-harder --rmdir \
155 - remotes/git-svn..mybranch5 &&
155 + ${remotes_git_svn}..mybranch5 &&
156 svn up "$SVN_TREE" &&
157 test -x "$SVN_TREE"/bar/zzz &&
158 test -L "$SVN_TREE"/exec-2.sh'
@@ -165,7 +165,7 @@ test_expect_success "$name" '
165 git update-index exec-2.sh &&
166 git commit -m "$name" &&
167 git-svn set-tree --find-copies-harder --rmdir \
168 - remotes/git-svn..mybranch5 &&
168 + ${remotes_git_svn}..mybranch5 &&
169 svn up "$SVN_TREE" &&
170 test -f "$SVN_TREE"/exec-2.sh &&
171 test ! -L "$SVN_TREE"/exec-2.sh &&
@@ -191,7 +191,7 @@ GIT_SVN_ID=alt
191 export GIT_SVN_ID
192 test_expect_success "$name" \
193 'git-svn init "$svnrepo" && git-svn fetch &&
194 - git rev-list --pretty=raw remotes/git-svn | grep ^tree | uniq > a &&
194 + git rev-list --pretty=raw ${remotes_git_svn} | grep ^tree | uniq > a &&
195 git rev-list --pretty=raw remotes/alt | grep ^tree | uniq > b &&
196 test_cmp a b'
197
@@ -215,7 +215,7 @@ test_expect_success "$name" "test_cmp a expected"
215
216 test_expect_success 'exit if remote refs are ambigious' "
217 git config --add svn-remote.svn.fetch \
218 - bar:refs/remotes/git-svn &&
218 + bar:refs/${remotes_git_svn} &&
219 test_must_fail git-svn migrate
220 "
221
@@ -223,7 +223,7 @@ test_expect_success 'exit if init-ing a would clobber a URL' '
223 svnadmin create "${PWD}/svnrepo2" &&
224 svn mkdir -m "mkdir bar" "${svnrepo}2/bar" &&
225 git config --unset svn-remote.svn.fetch \
226 - "^bar:refs/remotes/git-svn$" &&
226 + "^bar:refs/${remotes_git_svn}$" &&
227 test_must_fail git-svn init "${svnrepo}2/bar"
228 '
229
@@ -233,7 +233,7 @@ test_expect_success \
233 git config --get svn-remote.svn.fetch \
234 "^bar:refs/remotes/bar$" &&
235 git config --get svn-remote.svn.fetch \
236 - "^:refs/remotes/git-svn$"
236 + "^:refs/${remotes_git_svn}$"
237 '
238
239 test_expect_success 'able to dcommit to a subdirectory' "
t/t9101-git-svn-props.sh
+6 -6
@@ -71,11 +71,11 @@ test_expect_success 'fetch revisions from svn' 'git-svn fetch'
71
72 name='test svn:keywords ignoring'
73 test_expect_success "$name" \
74 - 'git checkout -b mybranch remotes/git-svn &&
74 + 'git checkout -b mybranch ${remotes_git_svn} &&
75 echo Hi again >> kw.c &&
76 git commit -a -m "test keywords ignoring" &&
77 - git-svn set-tree remotes/git-svn..mybranch &&
78 - git pull . remotes/git-svn'
77 + git-svn set-tree ${remotes_git_svn}..mybranch &&
78 + git pull . ${remotes_git_svn}'
79
80 expect='/* $Id$ */'
81 got="`sed -ne 2p kw.c`"
@@ -91,7 +91,7 @@ test_expect_success "propset CR on crlf files" \
91
92 test_expect_success 'fetch and pull latest from svn and checkout a new wc' \
93 'git-svn fetch &&
94 - git pull . remotes/git-svn &&
94 + git pull . ${remotes_git_svn} &&
95 svn co "$svnrepo" new_wc'
96
97 for i in crlf ne_crlf lf ne_lf cr ne_cr empty_cr empty_lf empty empty_crlf
@@ -113,7 +113,7 @@ cd test_wc
113 svn commit -m "propset CRLF on cr files"'
114 cd ..
115 test_expect_success 'fetch and pull latest from svn' \
116 - 'git-svn fetch && git pull . remotes/git-svn'
116 + 'git-svn fetch && git pull . ${remotes_git_svn}'
117
118 b_cr="`git-hash-object cr`"
119 b_ne_cr="`git-hash-object ne_cr`"
@@ -161,7 +161,7 @@ cat >create-ignore-index.expect <<\EOF
161 EOF
162
163 test_expect_success 'test create-ignore' "
164 - git-svn fetch && git pull . remotes/git-svn &&
164 + git-svn fetch && git pull . ${remotes_git_svn} &&
165 git-svn create-ignore &&
166 cmp ./.gitignore create-ignore.expect &&
167 cmp ./deeply/.gitignore create-ignore.expect &&
t/t9102-git-svn-deep-rmdir.sh
+1 -1
@@ -16,7 +16,7 @@ test_expect_success 'initialize repo' '
16 test_expect_success 'mirror via git-svn' '
17 git-svn init "$svnrepo" &&
18 git-svn fetch &&
19 - git checkout -f -b test-rmdir remotes/git-svn
19 + git checkout -f -b test-rmdir ${remotes_git_svn}
20 '
21
22 test_expect_success 'Try a commit on rmdir' '
t/t9106-git-svn-commit-diff-clobber.sh
+3 -3
@@ -42,7 +42,7 @@ test_expect_success 'commit complementing change from git' '
42 test_expect_success 'dcommit fails to commit because of conflict' '
43 git-svn init "$svnrepo" &&
44 git-svn fetch &&
45 - git reset --hard refs/remotes/git-svn &&
45 + git reset --hard refs/${remotes_git_svn} &&
46 svn co "$svnrepo" t.svn &&
47 cd t.svn &&
48 echo fourth line from svn >> file &&
@@ -56,7 +56,7 @@ test_expect_success 'dcommit fails to commit because of conflict' '
56 '
57
58 test_expect_success 'dcommit does the svn equivalent of an index merge' "
59 - git reset --hard refs/remotes/git-svn &&
59 + git reset --hard refs/${remotes_git_svn} &&
60 echo 'index merge' > file2 &&
61 git update-index --add file2 &&
62 git commit -a -m 'index merge' &&
@@ -77,7 +77,7 @@ test_expect_success 'commit another change from svn side' '
77 '
78
79 test_expect_success 'multiple dcommit from git-svn will not clobber svn' "
80 - git reset --hard refs/remotes/git-svn &&
80 + git reset --hard refs/${remotes_git_svn} &&
81 echo new file >> new-file &&
82 git update-index --add new-file &&
83 git commit -a -m 'new file' &&
t/t9107-git-svn-migrate.sh
+6 -6
@@ -19,9 +19,9 @@ test_expect_success 'setup old-looking metadata' '
19 mv "$GIT_DIR"/svn/* "$GIT_DIR"/ &&
20 mv "$GIT_DIR"/svn/.metadata "$GIT_DIR"/ &&
21 rmdir "$GIT_DIR"/svn &&
22 - git update-ref refs/heads/git-svn-HEAD refs/remotes/git-svn &&
23 - git update-ref refs/heads/svn-HEAD refs/remotes/git-svn &&
24 - git update-ref -d refs/remotes/git-svn refs/remotes/git-svn
22 + git update-ref refs/heads/git-svn-HEAD refs/${remotes_git_svn} &&
23 + git update-ref refs/heads/svn-HEAD refs/${remotes_git_svn} &&
24 + git update-ref -d refs/${remotes_git_svn} refs/${remotes_git_svn}
25 '
26
27 head=`git rev-parse --verify refs/heads/git-svn-HEAD^0`
@@ -33,11 +33,11 @@ test_expect_success 'initialize old-style (v0) git-svn layout' '
33 echo "$svnrepo" > "$GIT_DIR"/svn/info/url &&
34 git-svn migrate &&
35 ! test -d "$GIT_DIR"/git-svn &&
36 - git rev-parse --verify refs/remotes/git-svn^0 &&
36 + git rev-parse --verify refs/${remotes_git_svn}^0 &&
37 git rev-parse --verify refs/remotes/svn^0 &&
38 test "$(git config --get svn-remote.svn.url)" = "$svnrepo" &&
39 test `git config --get svn-remote.svn.fetch` = \
40 - ":refs/remotes/git-svn"
40 + ":refs/${remotes_git_svn}"
41 '
42
43 test_expect_success 'initialize a multi-repository repo' '
@@ -94,7 +94,7 @@ test_expect_success 'migrate --minimize on old inited layout' '
94 grep "^tags/0\.1:refs/remotes/tags/0\.1$" fetch.out &&
95 grep "^tags/0\.2:refs/remotes/tags/0\.2$" fetch.out &&
96 grep "^tags/0\.3:refs/remotes/tags/0\.3$" fetch.out
97 - grep "^:refs/remotes/git-svn" fetch.out
97 + grep "^:refs/${remotes_git_svn}" fetch.out
98 '
99
100 test_expect_success ".rev_db auto-converted to .rev_map.UUID" '
t/t9110-git-svn-use-svm-props.sh
+9 -9
@@ -22,31 +22,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
22 bar_url=http://mayonaise/svnrepo/bar
23 test_expect_success 'verify metadata for /bar' "
24 git cat-file commit refs/remotes/bar | \
25 - grep '^git-svn-id: $bar_url@12 $uuid$' &&
25 + grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
26 git cat-file commit refs/remotes/bar~1 | \
27 - grep '^git-svn-id: $bar_url@11 $uuid$' &&
27 + grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
28 git cat-file commit refs/remotes/bar~2 | \
29 - grep '^git-svn-id: $bar_url@10 $uuid$' &&
29 + grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
30 git cat-file commit refs/remotes/bar~3 | \
31 - grep '^git-svn-id: $bar_url@9 $uuid$' &&
31 + grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
32 git cat-file commit refs/remotes/bar~4 | \
33 - grep '^git-svn-id: $bar_url@6 $uuid$' &&
33 + grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
34 git cat-file commit refs/remotes/bar~5 | \
35 - grep '^git-svn-id: $bar_url@1 $uuid$'
35 + grep '^${git_svn_id}: $bar_url@1 $uuid$'
36 "
37
38 e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
39 test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
40 git cat-file commit refs/remotes/e | \
41 - grep '^git-svn-id: $e_url@1 $uuid$'
41 + grep '^${git_svn_id}: $e_url@1 $uuid$'
42 "
43
44 dir_url=http://mayonaise/svnrepo/dir
45 test_expect_success 'verify metadata for /dir' "
46 git cat-file commit refs/remotes/dir | \
47 - grep '^git-svn-id: $dir_url@2 $uuid$' &&
47 + grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
48 git cat-file commit refs/remotes/dir~1 | \
49 - grep '^git-svn-id: $dir_url@1 $uuid$'
49 + grep '^${git_svn_id}: $dir_url@1 $uuid$'
50 "
51
52 test_expect_success 'find commit based on SVN revision number' "
t/t9111-git-svn-use-svnsync-props.sh
+9 -9
@@ -21,31 +21,31 @@ uuid=161ce429-a9dd-4828-af4a-52023f968c89
21 bar_url=http://mayonaise/svnrepo/bar
22 test_expect_success 'verify metadata for /bar' "
23 git cat-file commit refs/remotes/bar | \
24 - grep '^git-svn-id: $bar_url@12 $uuid$' &&
24 + grep '^${git_svn_id}: $bar_url@12 $uuid$' &&
25 git cat-file commit refs/remotes/bar~1 | \
26 - grep '^git-svn-id: $bar_url@11 $uuid$' &&
26 + grep '^${git_svn_id}: $bar_url@11 $uuid$' &&
27 git cat-file commit refs/remotes/bar~2 | \
28 - grep '^git-svn-id: $bar_url@10 $uuid$' &&
28 + grep '^${git_svn_id}: $bar_url@10 $uuid$' &&
29 git cat-file commit refs/remotes/bar~3 | \
30 - grep '^git-svn-id: $bar_url@9 $uuid$' &&
30 + grep '^${git_svn_id}: $bar_url@9 $uuid$' &&
31 git cat-file commit refs/remotes/bar~4 | \
32 - grep '^git-svn-id: $bar_url@6 $uuid$' &&
32 + grep '^${git_svn_id}: $bar_url@6 $uuid$' &&
33 git cat-file commit refs/remotes/bar~5 | \
34 - grep '^git-svn-id: $bar_url@1 $uuid$'
34 + grep '^${git_svn_id}: $bar_url@1 $uuid$'
35 "
36
37 e_url=http://mayonaise/svnrepo/dir/a/b/c/d/e
38 test_expect_success 'verify metadata for /dir/a/b/c/d/e' "
39 git cat-file commit refs/remotes/e | \
40 - grep '^git-svn-id: $e_url@1 $uuid$'
40 + grep '^${git_svn_id}: $e_url@1 $uuid$'
41 "
42
43 dir_url=http://mayonaise/svnrepo/dir
44 test_expect_success 'verify metadata for /dir' "
45 git cat-file commit refs/remotes/dir | \
46 - grep '^git-svn-id: $dir_url@2 $uuid$' &&
46 + grep '^${git_svn_id}: $dir_url@2 $uuid$' &&
47 git cat-file commit refs/remotes/dir~1 | \
48 - grep '^git-svn-id: $dir_url@1 $uuid$'
48 + grep '^${git_svn_id}: $dir_url@1 $uuid$'
49 "
50
51 test_done
t/t9120-git-svn-clone-with-percent-escapes.sh
+1 -1
@@ -21,7 +21,7 @@ else
21 test_expect_success 'test clone with percent escapes' '
22 git svn clone "$svnrepo/pr%20ject" clone &&
23 cd clone &&
24 - git rev-parse refs/remotes/git-svn &&
24 + git rev-parse refs/${remotes_git_svn} &&
25 cd ..
26 '
27 fi
t/t9123-git-svn-rebuild-with-rewriteroot.sh
+1 -1
@@ -17,7 +17,7 @@ rm -rf import
17 test_expect_success 'init, fetch and checkout repository' '
18 git svn init --rewrite-root=http://invalid.invalid/ "$svnrepo" &&
19 git svn fetch
20 - git checkout -b mybranch remotes/git-svn
20 + git checkout -b mybranch ${remotes_git_svn}
21 '
22
23 test_expect_success 'remove rev_map' '