3 # Portions copyright (c) 2007, 2009 Sam Vilain
4 # Portions copyright (c) 2011 Bryan Jacobs
7 test_description
='git-svn svn mergeinfo propagation'
11 test_expect_success
'load svn dump' "
12 svnadmin load -q '$rawsvnrepo' \
13 < '$TEST_DIRECTORY/t9161/branches.dump' &&
14 git svn init --minimize-url -R svnmerge \
15 -T trunk -b branches '$svnrepo' &&
19 test_expect_success
'propagate merge information' '
20 git config svn.pushmergeinfo yes &&
22 git merge --no-ff svnb2 &&
26 test_expect_success
'check svn:mergeinfo' '
27 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1)
28 test "$mergeinfo" = "/branches/svnb2:3,8"
31 test_expect_success
'merge another branch' '
32 git merge --no-ff svnb3 &&
36 test_expect_success
'check primary parent mergeinfo respected' '
37 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1)
38 test "$mergeinfo" = "/branches/svnb2:3,8
42 test_expect_success
'merge existing merge' '
43 git merge --no-ff svnb4 &&
47 test_expect_success
"check both parents' mergeinfo respected" '
48 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1)
49 test "$mergeinfo" = "/branches/svnb2:3,8
51 /branches/svnb4:5-6,10-12
55 test_expect_success
'make further commits to branch' '
59 git commit -m "later b2 commit" &&
61 git add newb2file-2 &&
62 git commit -m "later b2 commit 2" &&
66 test_expect_success
'second forward merge' '
68 git merge --no-ff svnb2 &&
72 test_expect_success
'check new mergeinfo added' '
73 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1)
74 test "$mergeinfo" = "/branches/svnb2:3,8,16-17
76 /branches/svnb4:5-6,10-12
80 test_expect_success
'reintegration merge' '
82 git merge --no-ff svnb1 &&
86 test_expect_success
'check reintegration mergeinfo' '
87 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb4)
88 test "$mergeinfo" = "/branches/svnb1:2-4,7-9,13-18
89 /branches/svnb2:3,8,16-17
91 /branches/svnb4:5-6,10-12
95 test_expect_success
'dcommit a merge at the top of a stack' '
98 git add anotherfile &&
99 git commit -m "a commit" &&