3 # Copyright (c) 2013 Paul Walmsley - based on t9134 by Vitaly Shukela
6 test_description='git svn property tests'
9 test_expect_success 'setup test repository' '
10 svn_cmd co "$svnrepo" s &&
14 echo test_qqq > qqq/test_qqq.txt &&
15 echo test_www > www/test_www.txt &&
16 echo test_xxx > xxx/test_xxx.txt &&
20 svn_cmd commit -m "create some files" &&
22 echo hi >> www/test_www.txt &&
23 svn_cmd commit -m "modify www/test_www.txt" &&
28 test_expect_success 'clone an SVN repository with filter to include qqq directory' '
29 git svn clone --include-paths="qqq" "$svnrepo" g &&
30 echo test_qqq > expect &&
31 for i in g/*/*.txt; do cat $i >> expect2; done &&
32 test_cmp expect expect2
36 test_expect_success 'init+fetch an SVN repository with included qqq directory' '
37 git svn init "$svnrepo" c &&
38 ( cd c && git svn fetch --include-paths="qqq" ) &&
40 echo test_qqq > expect &&
41 for i in c/*/*.txt; do cat $i >> expect2; done &&
42 test_cmp expect expect2
45 test_expect_success 'verify include-paths config saved by clone' '
48 git config --get svn-remote.svn.include-paths | fgrep "qqq"
52 test_expect_success 'SVN-side change outside of www' '
55 echo b >> qqq/test_qqq.txt &&
56 svn_cmd commit -m "SVN-side change outside of www" &&
58 svn_cmd log -v | fgrep "SVN-side change outside of www"
62 test_expect_success 'update git svn-cloned repo (config include)' '
66 printf "test_qqq\nb\n" > expect &&
67 for i in */*.txt; do cat $i >> expect2; done &&
68 test_cmp expect2 expect &&
73 test_expect_success 'update git svn-cloned repo (option include)' '
76 git svn rebase --include-paths="qqq" &&
77 printf "test_qqq\nb\n" > expect &&
78 for i in */*.txt; do cat $i >> expect2; done &&
79 test_cmp expect2 expect &&
84 test_expect_success 'SVN-side change inside of ignored www' '
87 echo zaq >> www/test_www.txt &&
88 svn_cmd commit -m "SVN-side change inside of www/test_www.txt" &&
90 svn_cmd log -v | fgrep "SVN-side change inside of www/test_www.txt"
94 test_expect_success 'update git svn-cloned repo (config include)' '
98 printf "test_qqq\nb\n" > expect &&
99 for i in */*.txt; do cat $i >> expect2; done &&
100 test_cmp expect2 expect &&
105 test_expect_success 'update git svn-cloned repo (option include)' '
108 git svn rebase --include-paths="qqq" &&
109 printf "test_qqq\nb\n" > expect &&
110 for i in */*.txt; do cat $i >> expect2; done &&
111 test_cmp expect2 expect &&
116 test_expect_success 'SVN-side change in and out of included qqq' '
119 echo cvf >> www/test_www.txt &&
120 echo ygg >> qqq/test_qqq.txt &&
121 svn_cmd commit -m "SVN-side change in and out of ignored www" &&
123 svn_cmd log -v | fgrep "SVN-side change in and out of ignored www"
127 test_expect_success 'update git svn-cloned repo again (config include)' '
131 printf "test_qqq\nb\nygg\n" > expect &&
132 for i in */*.txt; do cat $i >> expect2; done &&
133 test_cmp expect2 expect &&
138 test_expect_success 'update git svn-cloned repo again (option include)' '
141 git svn rebase --include-paths="qqq" &&
142 printf "test_qqq\nb\nygg\n" > expect &&
143 for i in */*.txt; do cat $i >> expect2; done &&
144 test_cmp expect2 expect &&