|
1
|
# |
|
2
|
# Copyright (c) 2014 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 "merge" command |
|
19
|
# |
|
20
|
|
|
21
|
#################################################################### |
|
22
|
# TEST 1: Handle multiple merges each with one or more ADDED files # |
|
23
|
#################################################################### |
|
24
|
|
|
25
|
test_setup |
|
26
|
fossil ls |
|
27
|
|
|
28
|
test merge_multi-0 {[normalize_result] eq {}} |
|
29
|
|
|
30
|
write_file f1 "f1 line" |
|
31
|
fossil add f1 |
|
32
|
fossil commit -m "base file" |
|
33
|
fossil ls |
|
34
|
|
|
35
|
test merge_multi-1 {[normalize_result] eq {f1}} |
|
36
|
|
|
37
|
fossil update trunk |
|
38
|
write_file f2 "f2 line" |
|
39
|
fossil add f2 |
|
40
|
fossil commit -m "branch for file f2" -b branch_for_f2 |
|
41
|
fossil ls |
|
42
|
|
|
43
|
test merge_multi-2 {[normalize_result] eq {f1 |
|
44
|
f2}} |
|
45
|
|
|
46
|
fossil update trunk |
|
47
|
write_file f3 "f3 line" |
|
48
|
write_file f4 "f4 line" |
|
49
|
fossil add f3 |
|
50
|
fossil add f4 |
|
51
|
fossil commit -m "branch for files f3 and f4" -b branch_for_f3_f4 |
|
52
|
fossil ls |
|
53
|
|
|
54
|
test merge_multi-3 {[normalize_result] eq {f1 |
|
55
|
f3 |
|
56
|
f4}} |
|
57
|
|
|
58
|
fossil update trunk |
|
59
|
fossil merge branch_for_f2 |
|
60
|
fossil merge branch_for_f3_f4 |
|
61
|
fossil commit -m "new trunk files f2, f3, and f4 via merge" |
|
62
|
fossil ls |
|
63
|
|
|
64
|
test merge_multi-4 {[normalize_result] eq {f1 |
|
65
|
f2 |
|
66
|
f3 |
|
67
|
f4}} |
|
68
|
|
|
69
|
############################################################################### |
|
70
|
|
|
71
|
test_cleanup |
|
72
|
|