3 # Copyright (c) 2014 Alfred Perlstein
6 test_description
='git svn propset tests'
8 TEST_FAILS_SANITIZE_LEAK
=true
11 test_expect_success
'setup propset via import' '
12 test_when_finished "rm -rf import" &&
14 foo_subdir2="subdir/subdir2/foo_subdir2" &&
15 mkdir -p import/subdir/subdir2 &&
18 # for "add props top level"
20 # for "add props relative"
22 # for "add props subdir"
24 svn_cmd import -m "import for git svn" . "$svnrepo"
28 test_expect_success
'initialize git svn' '
29 git svn init "$svnrepo"
32 test_expect_success
'fetch revisions from svn' '
41 while [ $# -gt 0 ] ; do
42 git svn propset
"$1" "$2" "$file" ||
exit 1
45 echo hello
>> "$file" &&
46 git commit
-m "testing propset" "$file")
53 (set -e ; cd "svn_project/$subdir" &&
54 while [ $# -gt 0 ] ; do
55 test "$(svn_cmd propget "$1" "$file")" = "$2" ||
exit 1
61 #The current implementation has a restriction:
62 #svn propset will be taken as a delta for svn dcommit only
63 #if the file content is also modified
64 test_expect_success
'add props top level' '
65 set_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
67 svn_cmd co "$svnrepo" svn_project &&
68 confirm_props "." "foo" "svn:keywords" "FreeBSD=%H" &&
72 test_expect_success
'add multiple props' '
74 "svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
76 svn_cmd co "$svnrepo" svn_project &&
77 confirm_props "." "foo" \
78 "svn:keywords" "FreeBSD=%H" fbsd:nokeywords yes &&
82 test_expect_success
'add props subdir' '
83 set_props "." "$foo_subdir2" svn:keywords "FreeBSD=%H" &&
85 svn_cmd co "$svnrepo" svn_project &&
86 confirm_props "." "$foo_subdir2" "svn:keywords" "FreeBSD=%H" &&
90 test_expect_success
'add props relative' '
91 set_props "subdir/subdir2" "../foo_subdir" \
92 svn:keywords "FreeBSD=%H" &&
94 svn_cmd co "$svnrepo" svn_project &&
95 confirm_props "subdir/subdir2" "../foo_subdir" \
96 svn:keywords "FreeBSD=%H" &&