]> git.ipfire.org Git - thirdparty/git.git/blame - t/t9161-git-svn-mergeinfo-push.sh
The sixth batch
[thirdparty/git.git] / t / t9161-git-svn-mergeinfo-push.sh
CommitLineData
1e5814f3
BJ
1#!/bin/sh
2#
3# Portions copyright (c) 2007, 2009 Sam Vilain
4# Portions copyright (c) 2011 Bryan Jacobs
5#
6
7test_description='git-svn svn mergeinfo propagation'
8
9. ./lib-git-svn.sh
10
11test_expect_success 'load svn dump' "
12 svnadmin load -q '$rawsvnrepo' \
26e4266f 13 < '$TEST_DIRECTORY/t9161/branches.dump' &&
1e5814f3
BJ
14 git svn init --minimize-url -R svnmerge \
15 -T trunk -b branches '$svnrepo' &&
16 git svn fetch --all
17 "
18
19test_expect_success 'propagate merge information' '
20 git config svn.pushmergeinfo yes &&
fe191fca
JH
21 git checkout origin/svnb1 &&
22 git merge --no-ff origin/svnb2 &&
1e5814f3
BJ
23 git svn dcommit
24 '
25
26test_expect_success 'check svn:mergeinfo' '
49383dd4 27 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
1e5814f3
BJ
28 test "$mergeinfo" = "/branches/svnb2:3,8"
29 '
30
31test_expect_success 'merge another branch' '
fe191fca 32 git merge --no-ff origin/svnb3 &&
1e5814f3
BJ
33 git svn dcommit
34 '
35
36test_expect_success 'check primary parent mergeinfo respected' '
49383dd4 37 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
1e5814f3
BJ
38 test "$mergeinfo" = "/branches/svnb2:3,8
39/branches/svnb3:4,9"
40 '
41
42test_expect_success 'merge existing merge' '
fe191fca 43 git merge --no-ff origin/svnb4 &&
1e5814f3
BJ
44 git svn dcommit
45 '
46
47test_expect_success "check both parents' mergeinfo respected" '
49383dd4 48 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
1e5814f3
BJ
49 test "$mergeinfo" = "/branches/svnb2:3,8
50/branches/svnb3:4,9
51/branches/svnb4:5-6,10-12
52/branches/svnb5:6,11"
53 '
54
55test_expect_success 'make further commits to branch' '
fe191fca 56 git checkout origin/svnb2 &&
1e5814f3
BJ
57 touch newb2file &&
58 git add newb2file &&
59 git commit -m "later b2 commit" &&
60 touch newb2file-2 &&
61 git add newb2file-2 &&
62 git commit -m "later b2 commit 2" &&
63 git svn dcommit
64 '
65
66test_expect_success 'second forward merge' '
fe191fca
JH
67 git checkout origin/svnb1 &&
68 git merge --no-ff origin/svnb2 &&
1e5814f3
BJ
69 git svn dcommit
70 '
71
72test_expect_success 'check new mergeinfo added' '
49383dd4 73 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb1) &&
1e5814f3
BJ
74 test "$mergeinfo" = "/branches/svnb2:3,8,16-17
75/branches/svnb3:4,9
76/branches/svnb4:5-6,10-12
77/branches/svnb5:6,11"
78 '
79
80test_expect_success 'reintegration merge' '
fe191fca
JH
81 git checkout origin/svnb4 &&
82 git merge --no-ff origin/svnb1 &&
1e5814f3
BJ
83 git svn dcommit
84 '
85
86test_expect_success 'check reintegration mergeinfo' '
49383dd4 87 mergeinfo=$(svn_cmd propget svn:mergeinfo "$svnrepo"/branches/svnb4) &&
1e5814f3
BJ
88 test "$mergeinfo" = "/branches/svnb1:2-4,7-9,13-18
89/branches/svnb2:3,8,16-17
90/branches/svnb3:4,9
1e5814f3
BJ
91/branches/svnb5:6,11"
92 '
93
94test_expect_success 'dcommit a merge at the top of a stack' '
fe191fca 95 git checkout origin/svnb1 &&
1e5814f3
BJ
96 touch anotherfile &&
97 git add anotherfile &&
98 git commit -m "a commit" &&
fe191fca 99 git merge origin/svnb4 &&
1e5814f3
BJ
100 git svn dcommit
101 '
102
103test_done