@@ -11,93 +11,151 @@ mkdir foo.svn
11
11
svnadmin create foo.svn
12
12
svn co file://` pwd` /foo.svn foo
13
13
14
+ commit () {
15
+ i=$(( $1 + 1 ))
16
+ shift ;
17
+ svn commit -m " (r$i ) $* " > /dev/null || exit 1
18
+ echo $i
19
+ }
20
+
21
+ say () {
22
+ echo " [1m * $* [0m"
23
+ }
24
+
25
+ i=0
14
26
cd foo
15
27
mkdir trunk
16
28
mkdir branches
17
29
svn add trunk branches
18
- svn commit -m " Setup trunk and branches"
19
- cd trunk
30
+ i=$( commit $i " Setup trunk and branches" )
20
31
21
- git cat-file blob 6683463e:Makefile > Makefile
22
- svn add Makefile
32
+ git cat-file blob 6683463e:Makefile > trunk/ Makefile
33
+ svn add trunk/ Makefile
23
34
24
- echo " Committing ANCESTOR"
25
- svn commit -m " ancestor"
26
- cd ..
35
+ say " Committing ANCESTOR"
36
+ i=$( commit $i " ancestor" )
27
37
svn cp trunk branches/left
28
38
29
- echo " Committing BRANCH POINT"
30
- svn commit -m " make left branch"
39
+ say " Committing BRANCH POINT"
40
+ i= $( commit $i " make left branch" )
31
41
svn cp trunk branches/right
32
42
33
- echo " Committing other BRANCH POINT"
34
- svn commit -m " make right branch"
35
- cd branches/left/
43
+ say " Committing other BRANCH POINT"
44
+ i=$( commit $i " make right branch" )
36
45
37
- # $sm init
38
- # svn commit -m "init svnmerge"
46
+ say " Committing LEFT UPDATE"
47
+ git cat-file blob 5873b67e:Makefile > branches/left/Makefile
48
+ i=$( commit $i " left update 1" )
39
49
40
- git cat-file blob 5873b67e:Makefile > Makefile
41
- echo " Committing BRANCH UPDATE 1"
42
- svn commit -m " left update 1"
43
- cd ../..
44
-
45
- cd trunk
46
- git cat-file blob 75118b13:Makefile > Makefile
47
- echo " Committing TRUNK UPDATE"
48
- svn commit -m " trunk update"
50
+ git cat-file blob 75118b13:Makefile > branches/right/Makefile
51
+ say " Committing RIGHT UPDATE"
52
+ pre_right_update_1=$i
53
+ i=$( commit $i " right update 1" )
49
54
50
- cd ../branches/left
51
- git cat-file blob ff5ebe39:Makefile > Makefile
52
- echo " Committing BRANCH UPDATE 2"
53
- svn commit -m " left update 2"
55
+ say " Making more commits on LEFT"
56
+ git cat-file blob ff5ebe39:Makefile > branches/left/Makefile
57
+ i=$( commit $i " left update 2" )
58
+ git cat-file blob b5039db6:Makefile > branches/left/Makefile
59
+ i=$( commit $i " left update 3" )
54
60
55
- git cat-file blob b5039db6:Makefile > Makefile
56
- echo " Committing BRANCH UPDATE 3"
57
- svn commit -m " left update 3"
61
+ say " Making a LEFT SUB-BRANCH"
62
+ svn cp branches/left branches/left-sub
63
+ sub_left_make=$i
64
+ i=$( commit $i " make left sub-branch" )
58
65
59
- # merge to trunk
66
+ say " Making a commit on LEFT SUB-BRANCH"
67
+ echo " crunch" > branches/left-sub/README
68
+ svn add branches/left-sub/README
69
+ i=$( commit $i " left sub-branch update 1" )
60
70
61
- cd ../..
71
+ say " Merging LEFT to TRUNK "
62
72
svn update
63
73
cd trunk
64
-
65
74
svn merge ../branches/left --accept postpone
66
-
67
- git cat-file blob b51ad431:Makefile > Makefile
68
-
75
+ git cat-file blob b5039db6:Makefile > Makefile
69
76
svn resolved Makefile
77
+ i=$( commit $i " Merge left to trunk 1" )
78
+ cd ..
70
79
71
- svn commit -m " Merge trunk 1"
72
-
73
- # create commits on both branches
74
-
75
- cd ../branches/left
76
- git cat-file blob ff5ebe39:Makefile > Makefile
77
- echo " Committing BRANCH UPDATE 4"
78
- svn commit -m " left update 4"
79
-
80
- cd ../right
81
- git cat-file blob b5039db6:Makefile > Makefile
82
- echo " Committing other BRANCH UPDATE 1"
83
- svn commit -m " right update 1"
80
+ say " Making more commits on LEFT and RIGHT"
81
+ echo " touche" > branches/left/zlonk
82
+ svn add branches/left/zlonk
83
+ i=$( commit $i " left update 4" )
84
+ echo " thwacke" > branches/right/bang
85
+ svn add branches/right/bang
86
+ i=$( commit $i " right update 2" )
84
87
85
- # merge to trun again
88
+ say " Squash merge of RIGHT tip 2 commits onto TRUNK"
89
+ svn update
90
+ cd trunk
91
+ svn merge -r$pre_right_update_1 :$i ../branches/right
92
+ i=$( commit $i " Cherry-pick right 2 commits to trunk" )
93
+ cd ..
86
94
87
- cd ../..
95
+ say " Merging RIGHT to TRUNK "
88
96
svn update
89
97
cd trunk
98
+ svn merge ../branches/right --accept postpone
99
+ git cat-file blob b51ad431:Makefile > Makefile
100
+ svn resolved Makefile
101
+ i=$( commit $i " Merge right to trunk 1" )
102
+ cd ..
90
103
91
- svn merge ../branches/left --accept postpone
104
+ say " Making more commits on RIGHT and TRUNK"
105
+ echo " whamm" > branches/right/urkkk
106
+ svn add branches/right/urkkk
107
+ i=$( commit $i " right update 3" )
108
+ echo " pow" > trunk/vronk
109
+ svn add trunk/vronk
110
+ i=$( commit $i " trunk update 1" )
92
111
112
+ say " Merging RIGHT to LEFT SUB-BRANCH"
113
+ svn update
114
+ cd branches/left-sub
115
+ svn merge ../right --accept postpone
93
116
git cat-file blob b51ad431:Makefile > Makefile
94
-
95
117
svn resolved Makefile
118
+ i=$( commit $i " Merge right to left sub-branch" )
119
+ cd ../..
96
120
97
- svn commit -m " Merge trunk 2"
121
+ say " Making more commits on LEFT SUB-BRANCH and LEFT"
122
+ echo " zowie" > branches/left-sub/wham_eth
123
+ svn add branches/left-sub/wham_eth
124
+ pre_sub_left_update_2=$i
125
+ i=$( commit $i " left sub-branch update 2" )
126
+ sub_left_update_2=$i
127
+ echo " eee_yow" > branches/left/glurpp
128
+ svn add branches/left/glurpp
129
+ i=$( commit $i " left update 5" )
130
+
131
+ say " Cherry pick LEFT SUB-BRANCH commit to LEFT"
132
+ svn update
133
+ cd branches/left
134
+ svn merge -r$pre_sub_left_update_2 :$sub_left_update_2 ../left-sub
135
+ i=$( commit $i " Cherry-pick left sub-branch commit to left" )
136
+ cd ../..
98
137
138
+ say " Merging LEFT SUB-BRANCH back to LEFT"
139
+ svn update
140
+ cd branches/left
141
+ # it's only a merge because the previous merge cherry-picked the top commit
142
+ svn merge -r$sub_left_make :$sub_left_update_2 ../left-sub --accept postpone
143
+ i=$( commit $i " Merge left sub-branch to left" )
99
144
cd ../..
100
145
146
+ say " Merging EVERYTHING to TRUNK"
147
+ svn update
148
+ cd trunk
149
+ svn merge ../branches/left --accept postpone
150
+ svn resolved bang
151
+ i=$( commit $i " Merge left to trunk 2" )
152
+ # this merge, svn happily updates the mergeinfo, but there is actually
153
+ # nothing to merge. git-svn will not make a meaningless merge commit.
154
+ svn merge ../branches/right --accept postpone
155
+ i=$( commit $i " non-merge right to trunk 2" )
156
+ cd ..
157
+
158
+ cd ..
101
159
svnadmin dump foo.svn > svn-mergeinfo.dump
102
160
103
161
rm -rf foo foo.svn
0 commit comments