3 # Copyright (c) 2014 Alfred Perlstein
6 test_description
='git svn propset tests'
10 test_expect_success
'setup propset via import' '
11 test_when_finished "rm -rf import" &&
13 foo_subdir2="subdir/subdir2/foo_subdir2" &&
14 mkdir -p import/subdir/subdir2 &&
17 # for "add props top level"
19 # for "add props relative"
21 # for "add props subdir"
23 svn_cmd import -m "import for git svn" . "$svnrepo"
27 test_expect_success
'initialize git svn' '
28 git svn init "$svnrepo"
31 test_expect_success
'fetch revisions from svn' '
40 while [ $# -gt 0 ] ; do
41 git svn propset
"$1" "$2" "$file" ||
exit 1
44 echo hello
>> "$file" &&
45 git commit
-m "testing propset" "$file")
52 (set -e ; cd "svn_project/$subdir" &&
53 while [ $# -gt 0 ] ; do
54 test "$(svn_cmd propget "$1" "$file")" = "$2" ||
exit 1
60 #The current implementation has a restriction:
61 #svn propset will be taken as a delta for svn dcommit only
62 #if the file content is also modified
63 test_expect_success
'add props top level' '
64 set_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
66 svn_cmd co "$svnrepo" svn_project &&
67 confirm_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
71 test_expect_success
'add multiple props' '
73 "svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
75 svn_cmd co "$svnrepo" svn_project &&
76 confirm_props "." "foo" \
77 "svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
81 test_expect_success
'add props subdir' '
82 set_props "." "$foo_subdir2" svn:keywords "FreeBSD=%H" &&
84 svn_cmd co "$svnrepo" svn_project &&
85 confirm_props "." "$foo_subdir2" "svn:keywords" "FreeBSD=%H" &&
89 test_expect_success
'add props relative' '
90 set_props "subdir/subdir2" "../foo_subdir" \
91 svn:keywords "FreeBSD=%H" &&
93 svn_cmd co "$svnrepo" svn_project &&
94 confirm_props "subdir/subdir2" "../foo_subdir" \
95 svn:keywords "FreeBSD=%H" &&