]>
Commit | Line | Data |
---|---|---|
242522d9 VS |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2009 Vitaly Shukela | |
4 | # Copyright (c) 2009 Eric Wong | |
5 | # | |
6 | ||
7 | test_description='git svn property tests' | |
8 | . ./lib-git-svn.sh | |
9 | ||
10 | test_expect_success 'setup test repository' ' | |
da083d68 | 11 | svn_cmd co "$svnrepo" s && |
242522d9 VS |
12 | ( |
13 | cd s && | |
14 | mkdir qqq www && | |
15 | echo test_qqq > qqq/test_qqq.txt && | |
16 | echo test_www > www/test_www.txt && | |
da083d68 ER |
17 | svn_cmd add qqq && |
18 | svn_cmd add www && | |
19 | svn_cmd commit -m "create some files" && | |
20 | svn_cmd up && | |
242522d9 | 21 | echo hi >> www/test_www.txt && |
da083d68 ER |
22 | svn_cmd commit -m "modify www/test_www.txt" && |
23 | svn_cmd up | |
242522d9 VS |
24 | ) |
25 | ' | |
26 | ||
27 | test_expect_success 'clone an SVN repository with ignored www directory' ' | |
28 | git svn clone --ignore-paths="^www" "$svnrepo" g && | |
29 | echo test_qqq > expect && | |
30 | for i in g/*/*.txt; do cat $i >> expect2; done && | |
31 | test_cmp expect expect2 | |
32 | ' | |
33 | ||
0d8bee71 BJ |
34 | test_expect_success 'init+fetch an SVN repository with ignored www directory' ' |
35 | git svn init "$svnrepo" c && | |
36 | ( cd c && git svn fetch --ignore-paths="^www" ) && | |
37 | rm expect2 && | |
38 | echo test_qqq > expect && | |
39 | for i in c/*/*.txt; do cat $i >> expect2; done && | |
40 | test_cmp expect expect2 | |
41 | ' | |
42 | ||
88ec2054 | 43 | test_expect_success 'verify ignore-paths config saved by clone' ' |
0d8bee71 BJ |
44 | ( |
45 | cd g && | |
88ec2054 | 46 | git config --get svn-remote.svn.ignore-paths | fgrep "www" |
0d8bee71 BJ |
47 | ) |
48 | ' | |
49 | ||
242522d9 VS |
50 | test_expect_success 'SVN-side change outside of www' ' |
51 | ( | |
52 | cd s && | |
53 | echo b >> qqq/test_qqq.txt && | |
da083d68 ER |
54 | svn_cmd commit -m "SVN-side change outside of www" && |
55 | svn_cmd up && | |
56 | svn_cmd log -v | fgrep "SVN-side change outside of www" | |
242522d9 VS |
57 | ) |
58 | ' | |
59 | ||
0d8bee71 | 60 | test_expect_success 'update git svn-cloned repo (config ignore)' ' |
242522d9 VS |
61 | ( |
62 | cd g && | |
0d8bee71 BJ |
63 | git svn rebase && |
64 | printf "test_qqq\nb\n" > expect && | |
65 | for i in */*.txt; do cat $i >> expect2; done && | |
66 | test_cmp expect2 expect && | |
67 | rm expect expect2 | |
68 | ) | |
69 | ' | |
70 | ||
71 | test_expect_success 'update git svn-cloned repo (option ignore)' ' | |
72 | ( | |
73 | cd c && | |
242522d9 VS |
74 | git svn rebase --ignore-paths="^www" && |
75 | printf "test_qqq\nb\n" > expect && | |
76 | for i in */*.txt; do cat $i >> expect2; done && | |
77 | test_cmp expect2 expect && | |
78 | rm expect expect2 | |
79 | ) | |
80 | ' | |
81 | ||
82 | test_expect_success 'SVN-side change inside of ignored www' ' | |
83 | ( | |
84 | cd s && | |
cff4243d | 85 | echo zaq >> www/test_www.txt && |
da083d68 ER |
86 | svn_cmd commit -m "SVN-side change inside of www/test_www.txt" && |
87 | svn_cmd up && | |
88 | svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt" | |
242522d9 VS |
89 | ) |
90 | ' | |
91 | ||
0d8bee71 | 92 | test_expect_success 'update git svn-cloned repo (config ignore)' ' |
242522d9 VS |
93 | ( |
94 | cd g && | |
0d8bee71 BJ |
95 | git svn rebase && |
96 | printf "test_qqq\nb\n" > expect && | |
97 | for i in */*.txt; do cat $i >> expect2; done && | |
98 | test_cmp expect2 expect && | |
99 | rm expect expect2 | |
100 | ) | |
101 | ' | |
102 | ||
103 | test_expect_success 'update git svn-cloned repo (option ignore)' ' | |
104 | ( | |
105 | cd c && | |
242522d9 VS |
106 | git svn rebase --ignore-paths="^www" && |
107 | printf "test_qqq\nb\n" > expect && | |
108 | for i in */*.txt; do cat $i >> expect2; done && | |
109 | test_cmp expect2 expect && | |
110 | rm expect expect2 | |
111 | ) | |
112 | ' | |
113 | ||
114 | test_expect_success 'SVN-side change in and out of ignored www' ' | |
115 | ( | |
116 | cd s && | |
cff4243d ES |
117 | echo cvf >> www/test_www.txt && |
118 | echo ygg >> qqq/test_qqq.txt && | |
da083d68 ER |
119 | svn_cmd commit -m "SVN-side change in and out of ignored www" && |
120 | svn_cmd up && | |
121 | svn_cmd log -v | fgrep "SVN-side change in and out of ignored www" | |
242522d9 VS |
122 | ) |
123 | ' | |
124 | ||
0d8bee71 | 125 | test_expect_success 'update git svn-cloned repo again (config ignore)' ' |
242522d9 VS |
126 | ( |
127 | cd g && | |
0d8bee71 BJ |
128 | git svn rebase && |
129 | printf "test_qqq\nb\nygg\n" > expect && | |
130 | for i in */*.txt; do cat $i >> expect2; done && | |
131 | test_cmp expect2 expect && | |
132 | rm expect expect2 | |
133 | ) | |
134 | ' | |
135 | ||
136 | test_expect_success 'update git svn-cloned repo again (option ignore)' ' | |
137 | ( | |
138 | cd c && | |
242522d9 VS |
139 | git svn rebase --ignore-paths="^www" && |
140 | printf "test_qqq\nb\nygg\n" > expect && | |
141 | for i in */*.txt; do cat $i >> expect2; done && | |
142 | test_cmp expect2 expect && | |
143 | rm expect expect2 | |
144 | ) | |
145 | ' | |
146 | ||
147 | test_done |