Fossil SCM

fossil-scm / test / merge1.test
Blame History Raw 434 lines
1
#
2
# Copyright (c) 2006 D. Richard Hipp
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the Simplified BSD License (also
6
# known as the "2-Clause License" or "FreeBSD License".)
7
#
8
# This program is distributed in the hope that it will be useful,
9
# but without any warranty; without even the implied warranty of
10
# merchantability or fitness for a particular purpose.
11
#
12
# Author contact information:
13
# [email protected]
14
# http://www.hwaci.com/drh/
15
#
16
############################################################################
17
#
18
# Tests of the 3-way merge
19
#
20
21
test_setup ""
22
23
write_file_indented t1 {
24
111 - This is line one of the demo program - 1111
25
222 - The second line program line in code - 2222
26
333 - This is a test of the merging algohm - 3333
27
444 - If all goes well, we will be pleased - 4444
28
555 - we think it well and other stuff too - 5555
29
}
30
write_file_indented t2 {
31
111 - This is line ONE of the demo program - 1111
32
222 - The second line program line in code - 2222
33
333 - This is a test of the merging algohm - 3333
34
444 - If all goes well, we will be pleased - 4444
35
555 - we think it well and other stuff too - 5555
36
}
37
write_file_indented t3 {
38
111 - This is line one of the demo program - 1111
39
222 - The second line program line in code - 2222
40
333 - This is a test OF THE merging algohm - 3333
41
444 - If all goes well, we will be pleased - 4444
42
555 - we think it well and other stuff too - 5555
43
}
44
write_file_indented t23 {
45
111 - This is line ONE of the demo program - 1111
46
222 - The second line program line in code - 2222
47
333 - This is a test OF THE merging algohm - 3333
48
444 - If all goes well, we will be pleased - 4444
49
555 - we think it well and other stuff too - 5555
50
}
51
fossil 3-way-merge t1 t3 t2 a32
52
test merge1-1.1 {[same_file t23 a32]}
53
fossil 3-way-merge t1 t2 t3 a23
54
test merge1-1.2 {[same_file t23 a23]}
55
56
write_file_indented t1 {
57
111 - This is line one of the demo program - 1111
58
222 - The second line program line in code - 2222
59
333 - This is a test of the merging algohm - 3333
60
444 - If all goes well, we will be pleased - 4444
61
555 - we think it well and other stuff too - 5555
62
}
63
write_file_indented t2 {
64
111 - This is line ONE of the demo program - 1111
65
222 - The second line program line in code - 2222
66
333 - This is a test of the merging algohm - 3333
67
444 - If all goes well, we will be pleased - 4444
68
555 - we think it well and other stuff too - 5555
69
}
70
write_file_indented t3 {
71
111 - This is line one OF the demo program - 1111
72
222 - The second line program line in code - 2222
73
333 - This is a test of the merging algohm - 3333
74
444 - If all goes well, we will be pleased - 4444
75
555 - we think it well and other stuff too - 5555
76
}
77
write_file_indented t23 {
78
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 1)
79
111 - This is line ONE of the demo program - 1111
80
####### SUGGESTED CONFLICT RESOLUTION follows ###################
81
111 - This is line ONE OF the demo program - 1111
82
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 1)
83
111 - This is line one of the demo program - 1111
84
======= MERGED IN content follows =============================== (line 1)
85
111 - This is line one OF the demo program - 1111
86
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
87
222 - The second line program line in code - 2222
88
333 - This is a test of the merging algohm - 3333
89
444 - If all goes well, we will be pleased - 4444
90
555 - we think it well and other stuff too - 5555
91
}
92
write_file_indented t32 {
93
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 1)
94
111 - This is line one OF the demo program - 1111
95
####### SUGGESTED CONFLICT RESOLUTION follows ###################
96
111 - This is line ONE OF the demo program - 1111
97
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 1)
98
111 - This is line one of the demo program - 1111
99
======= MERGED IN content follows =============================== (line 1)
100
111 - This is line ONE of the demo program - 1111
101
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
102
222 - The second line program line in code - 2222
103
333 - This is a test of the merging algohm - 3333
104
444 - If all goes well, we will be pleased - 4444
105
555 - we think it well and other stuff too - 5555
106
}
107
fossil 3-way-merge t1 t3 t2 a32 -expectError
108
test merge1-2.1 {[same_file t32 a32]}
109
fossil 3-way-merge t1 t2 t3 a23 -expectError
110
test merge1-2.2 {[same_file t23 a23]}
111
112
write_file_indented t1 {
113
111 - This is line one of the demo program - 1111
114
222 - The second line program line in code - 2222
115
333 - This is a test of the merging algohm - 3333
116
444 - If all goes well, we will be pleased - 4444
117
555 - we think it well and other stuff too - 5555
118
}
119
write_file_indented t2 {
120
111 - This is line ONE of the demo program - 1111
121
222 - The second line program line in code - 2222
122
333 - This is a test of the merging algohm - 3333
123
444 - If all goes well, we will be pleased - 4444
124
555 - we think it well and other stuff too - 5555
125
}
126
write_file_indented t3 {
127
111 - This is line ONE of the demo program - 1111
128
222 - The second line program line in code - 2222
129
333 - This is a test of the merging algohm - 3333
130
444 - If all goes well, we will be pleased - 4444
131
555 - we think it well and other stuff too - 5555
132
}
133
write_file_indented t23 {
134
111 - This is line ONE of the demo program - 1111
135
222 - The second line program line in code - 2222
136
333 - This is a test of the merging algohm - 3333
137
444 - If all goes well, we will be pleased - 4444
138
555 - we think it well and other stuff too - 5555
139
}
140
fossil 3-way-merge t1 t3 t2 a32
141
test merge1-3.1 {[same_file t23 a32]}
142
fossil 3-way-merge t1 t2 t3 a23
143
test merge1-3.2 {[same_file t23 a23]}
144
145
write_file_indented t1 {
146
111 - This is line one of the demo program - 1111
147
222 - The second line program line in code - 2222
148
333 - This is a test of the merging algohm - 3333
149
444 - If all goes well, we will be pleased - 4444
150
555 - we think it well and other stuff too - 5555
151
}
152
write_file_indented t2 {
153
000 - Zero lines added to the beginning of - 0000
154
111 - This is line one of the demo program - 1111
155
222 - The second line program line in code - 2222
156
333 - This is a test of the merging algohm - 3333
157
444 - If all goes well, we will be pleased - 4444
158
555 - we think it well and other stuff too - 5555
159
}
160
write_file_indented t3 {
161
222 - The second line program line in code - 2222
162
333 - This is a test of the merging algohm - 3333
163
444 - If all goes well, we will be pleased - 4444
164
555 - we think it well and other stuff too - 5555
165
}
166
write_file_indented t32 {
167
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 1)
168
####### SUGGESTED CONFLICT RESOLUTION follows ###################
169
000 - Zero lines added to the beginning of - 0000
170
111 - This is line one of the demo program - 1111
171
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 1)
172
111 - This is line one of the demo program - 1111
173
======= MERGED IN content follows =============================== (line 1)
174
000 - Zero lines added to the beginning of - 0000
175
111 - This is line one of the demo program - 1111
176
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
177
222 - The second line program line in code - 2222
178
333 - This is a test of the merging algohm - 3333
179
444 - If all goes well, we will be pleased - 4444
180
555 - we think it well and other stuff too - 5555
181
}
182
write_file_indented t23 {
183
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 1)
184
000 - Zero lines added to the beginning of - 0000
185
111 - This is line one of the demo program - 1111
186
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 1)
187
111 - This is line one of the demo program - 1111
188
======= MERGED IN content follows =============================== (line 1)
189
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
190
222 - The second line program line in code - 2222
191
333 - This is a test of the merging algohm - 3333
192
444 - If all goes well, we will be pleased - 4444
193
555 - we think it well and other stuff too - 5555
194
}
195
fossil 3-way-merge t1 t3 t2 a32 -expectError
196
test merge1-4.1 {[same_file t32 a32]}
197
fossil 3-way-merge t1 t2 t3 a23 -expectError
198
test merge1-4.2 {[same_file t23 a23]}
199
200
write_file_indented t1 {
201
111 - This is line one of the demo program - 1111
202
222 - The second line program line in code - 2222
203
333 - This is a test of the merging algohm - 3333
204
444 - If all goes well, we will be pleased - 4444
205
555 - we think it well and other stuff too - 5555
206
}
207
write_file_indented t2 {
208
111 - This is line one of the demo program - 1111
209
222 - The second line program line in code - 2222
210
333 - This is a test of the merging algohm - 3333
211
444 - If all goes well, we will be pleased - 4444
212
555 - we think it well and other stuff too - 5555
213
666 - Extra line at the end of the file wi - 6666
214
}
215
write_file_indented t3 {
216
222 - The second line program line in code - 2222
217
333 - This is a test of the merging algohm - 3333
218
444 - If all goes well, we will be pleased - 4444
219
555 - we think it well and other stuff too - 5555
220
}
221
write_file_indented t32 {
222
222 - The second line program line in code - 2222
223
333 - This is a test of the merging algohm - 3333
224
444 - If all goes well, we will be pleased - 4444
225
555 - we think it well and other stuff too - 5555
226
666 - Extra line at the end of the file wi - 6666
227
}
228
fossil 3-way-merge t1 t3 t2 a32
229
test merge1-5.1 {[same_file t32 a32]}
230
fossil 3-way-merge t1 t2 t3 a23
231
test merge1-5.2 {[same_file t32 a23]}
232
233
write_file_indented t1 {
234
111 - This is line one of the demo program - 1111
235
222 - The second line program line in code - 2222
236
333 - This is a test of the merging algohm - 3333
237
444 - If all goes well, we will be pleased - 4444
238
555 - we think it well and other stuff too - 5555
239
}
240
write_file_indented t2 {
241
111 - This is line one of the demo program - 1111
242
333 - This is a test of the merging algohm - 3333
243
444 - If all goes well, we will be pleased - 4444
244
555 - we think it well and other stuff too - 5555
245
}
246
write_file_indented t3 {
247
111 - This is line one of the demo program - 1111
248
222 - The second line program line in code - 2222
249
333 - This is a test of the merging algohm - 3333
250
555 - we think it well and other stuff too - 5555
251
}
252
write_file_indented t32 {
253
111 - This is line one of the demo program - 1111
254
333 - This is a test of the merging algohm - 3333
255
555 - we think it well and other stuff too - 5555
256
}
257
fossil 3-way-merge t1 t3 t2 a32
258
test merge1-6.1 {[same_file t32 a32]}
259
fossil 3-way-merge t1 t2 t3 a23
260
test merge1-6.2 {[same_file t32 a23]}
261
262
write_file_indented t1 {
263
abcd
264
efgh
265
ijkl
266
mnop
267
qrst
268
uvwx
269
yzAB
270
CDEF
271
GHIJ
272
KLMN
273
OPQR
274
STUV
275
XYZ.
276
}
277
write_file_indented t2 {
278
abcd
279
efgh 2
280
ijkl 2
281
mnop 2
282
qrst
283
uvwx
284
yzAB 2
285
CDEF 2
286
GHIJ 2
287
KLMN
288
OPQR
289
STUV
290
XYZ.
291
}
292
write_file_indented t3 {
293
abcd
294
efgh
295
ijkl
296
mnop 3
297
qrst 3
298
uvwx 3
299
yzAB 3
300
CDEF
301
GHIJ
302
KLMN
303
OPQR
304
STUV
305
XYZ.
306
}
307
write_file_indented t23 {
308
abcd
309
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 2)
310
efgh 2
311
ijkl 2
312
mnop 2
313
qrst
314
uvwx
315
yzAB 2
316
CDEF 2
317
GHIJ 2
318
####### SUGGESTED CONFLICT RESOLUTION follows ###################
319
efgh 2
320
ijkl 2
321
mnop 3
322
qrst 3
323
uvwx 3
324
yzAB 3
325
CDEF 2
326
GHIJ 2
327
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 2)
328
efgh
329
ijkl
330
mnop
331
qrst
332
uvwx
333
yzAB
334
CDEF
335
GHIJ
336
======= MERGED IN content follows =============================== (line 2)
337
efgh
338
ijkl
339
mnop 3
340
qrst 3
341
uvwx 3
342
yzAB 3
343
CDEF
344
GHIJ
345
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
346
KLMN
347
OPQR
348
STUV
349
XYZ.
350
}
351
fossil 3-way-merge t1 t2 t3 a23 -expectError
352
test merge1-7.1 {[same_file t23 a23]}
353
354
write_file_indented t2 {
355
abcd
356
efgh 2
357
ijkl 2
358
mnop
359
qrst
360
uvwx
361
yzAB 2
362
CDEF 2
363
GHIJ 2
364
KLMN
365
OPQR
366
STUV
367
XYZ.
368
}
369
write_file_indented t3 {
370
abcd
371
efgh
372
ijkl
373
mnop 3
374
qrst 3
375
uvwx 3
376
yzAB 3
377
CDEF
378
GHIJ
379
KLMN
380
OPQR
381
STUV
382
XYZ.
383
}
384
write_file_indented t23 {
385
abcd
386
<<<<<<< BEGIN MERGE CONFLICT: local copy shown first <<<<<<<<<<<< (line 2)
387
efgh 2
388
ijkl 2
389
mnop
390
qrst
391
uvwx
392
yzAB 2
393
CDEF 2
394
GHIJ 2
395
####### SUGGESTED CONFLICT RESOLUTION follows ###################
396
efgh 2
397
ijkl 2
398
mnop 3
399
qrst 3
400
uvwx 3
401
yzAB 3
402
CDEF 2
403
GHIJ 2
404
||||||| COMMON ANCESTOR content follows ||||||||||||||||||||||||| (line 2)
405
efgh
406
ijkl
407
mnop
408
qrst
409
uvwx
410
yzAB
411
CDEF
412
GHIJ
413
======= MERGED IN content follows =============================== (line 2)
414
efgh
415
ijkl
416
mnop 3
417
qrst 3
418
uvwx 3
419
yzAB 3
420
CDEF
421
GHIJ
422
>>>>>>> END MERGE CONFLICT >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
423
KLMN
424
OPQR
425
STUV
426
XYZ.
427
}
428
fossil 3-way-merge t1 t2 t3 a23 -expectError
429
test merge1-7.2 {[same_file t23 a23]}
430
431
###############################################################################
432
433
test_cleanup
434

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button