Show More
@@ -1,61 +1,172 b'' | |||
|
1 | #!/bin/sh | |
|
2 | 1 | |
|
3 | cp "$TESTDIR"/../contrib/simplemerge . | |
|
2 | $ cp "$TESTDIR"/../contrib/simplemerge . | |
|
3 | $ echo base > base | |
|
4 | $ echo local > local | |
|
5 | $ cat base >> local | |
|
6 | $ cp local orig | |
|
7 | $ cat base > other | |
|
8 | $ echo other >> other | |
|
4 | 9 | |
|
5 | echo base > base | |
|
10 | changing local directly | |
|
6 | 11 | |
|
7 | echo local > local | |
|
8 | cat base >> local | |
|
9 | cp local orig | |
|
12 | $ python simplemerge local base other && echo "merge succeeded" | |
|
13 | merge succeeded | |
|
14 | $ cat local | |
|
15 | local | |
|
16 | base | |
|
17 | other | |
|
18 | $ cp orig local | |
|
19 | ||
|
20 | printing to stdout | |
|
10 | 21 | |
|
11 | cat base > other | |
|
12 | echo other >> other | |
|
22 | $ python simplemerge -p local base other | |
|
23 | local | |
|
24 | base | |
|
25 | other | |
|
26 | ||
|
27 | local: | |
|
28 | ||
|
29 | $ cat local | |
|
30 | local | |
|
31 | base | |
|
32 | ||
|
33 | conflicts | |
|
13 | 34 | |
|
14 | echo '% changing local directly' | |
|
15 | python simplemerge local base other && echo "merge succeeded" | |
|
16 | cat local | |
|
17 | cp orig local | |
|
35 | $ cp base conflict-local | |
|
36 | $ cp other conflict-other | |
|
37 | $ echo not other >> conflict-local | |
|
38 | $ echo end >> conflict-local | |
|
39 | $ echo end >> conflict-other | |
|
40 | $ python simplemerge -p conflict-local base conflict-other | |
|
41 | base | |
|
42 | <<<<<<< conflict-local | |
|
43 | not other | |
|
44 | ======= | |
|
45 | other | |
|
46 | >>>>>>> conflict-other | |
|
47 | end | |
|
48 | warning: conflicts during merge. | |
|
49 | [1] | |
|
50 | ||
|
51 | --no-minimal | |
|
18 | 52 | |
|
19 | echo '% printing to stdout' | |
|
20 | python simplemerge -p local base other | |
|
21 | echo ' local:' | |
|
22 | cat local | |
|
53 | $ python simplemerge -p --no-minimal conflict-local base conflict-other | |
|
54 | base | |
|
55 | <<<<<<< conflict-local | |
|
56 | not other | |
|
57 | end | |
|
58 | ======= | |
|
59 | other | |
|
60 | end | |
|
61 | >>>>>>> conflict-other | |
|
62 | warning: conflicts during merge. | |
|
63 | [1] | |
|
23 | 64 | |
|
24 | echo '% conflicts' | |
|
25 | cp base conflict-local | |
|
26 | cp other conflict-other | |
|
27 | echo not other >> conflict-local | |
|
28 | echo end >> conflict-local | |
|
29 | echo end >> conflict-other | |
|
30 | python simplemerge -p conflict-local base conflict-other || echo "merge failed" | |
|
65 | 1 label | |
|
66 | ||
|
67 | $ python simplemerge -p -L foo conflict-local base conflict-other | |
|
68 | base | |
|
69 | <<<<<<< foo | |
|
70 | not other | |
|
71 | ======= | |
|
72 | other | |
|
73 | >>>>>>> conflict-other | |
|
74 | end | |
|
75 | warning: conflicts during merge. | |
|
76 | [1] | |
|
77 | ||
|
78 | 2 labels | |
|
31 | 79 | |
|
32 | echo '% --no-minimal' | |
|
33 | python simplemerge -p --no-minimal conflict-local base conflict-other | |
|
80 | $ python simplemerge -p -L foo -L bar conflict-local base conflict-other | |
|
81 | base | |
|
82 | <<<<<<< foo | |
|
83 | not other | |
|
84 | ======= | |
|
85 | other | |
|
86 | >>>>>>> bar | |
|
87 | end | |
|
88 | warning: conflicts during merge. | |
|
89 | [1] | |
|
34 | 90 | |
|
35 | echo '% 1 label' | |
|
36 | python simplemerge -p -L foo conflict-local base conflict-other | |
|
91 | too many labels | |
|
92 | ||
|
93 | $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other | |
|
94 | abort: can only specify two labels. | |
|
95 | [255] | |
|
37 | 96 | |
|
38 | echo '% 2 labels' | |
|
39 | python simplemerge -p -L foo -L bar conflict-local base conflict-other | |
|
97 | binary file | |
|
98 | ||
|
99 | $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()" | |
|
100 | $ cat orig >> binary-local | |
|
101 | $ python simplemerge -p binary-local base other | |
|
102 | abort: binary-local looks like a binary file. | |
|
103 | [255] | |
|
40 | 104 | |
|
41 | echo '% too many labels' | |
|
42 | python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other | |
|
105 | binary file --text | |
|
106 | ||
|
107 | $ python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py | |
|
108 | warning: binary-local looks like a binary file. | |
|
109 | \x00local | |
|
110 | base | |
|
111 | other | |
|
112 | ||
|
113 | help | |
|
43 | 114 | |
|
44 | echo '% binary file' | |
|
45 | python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()" | |
|
46 | cat orig >> binary-local | |
|
47 | python simplemerge -p binary-local base other | |
|
115 | $ python simplemerge --help | |
|
116 | simplemerge [OPTS] LOCAL BASE OTHER | |
|
117 | ||
|
118 | Simple three-way file merge utility with a minimal feature set. | |
|
119 | ||
|
120 | Apply to LOCAL the changes necessary to go from BASE to OTHER. | |
|
121 | ||
|
122 | By default, LOCAL is overwritten with the results of this operation. | |
|
123 | ||
|
124 | options: | |
|
125 | -L --label labels to use on conflict markers | |
|
126 | -a --text treat all files as text | |
|
127 | -p --print print results instead of overwriting LOCAL | |
|
128 | --no-minimal do not try to minimize conflict regions | |
|
129 | -h --help display help and exit | |
|
130 | -q --quiet suppress output | |
|
48 | 131 | |
|
49 | echo '% binary file --text' | |
|
50 | python simplemerge -a -p binary-local base other 2>&1 | $TESTDIR/printrepr.py | |
|
132 | wrong number of arguments | |
|
51 | 133 | |
|
52 | echo '% help' | |
|
53 | python simplemerge --help | |
|
134 | $ python simplemerge | |
|
135 | simplemerge: wrong number of arguments | |
|
136 | simplemerge [OPTS] LOCAL BASE OTHER | |
|
137 | ||
|
138 | Simple three-way file merge utility with a minimal feature set. | |
|
139 | ||
|
140 | Apply to LOCAL the changes necessary to go from BASE to OTHER. | |
|
141 | ||
|
142 | By default, LOCAL is overwritten with the results of this operation. | |
|
143 | ||
|
144 | options: | |
|
145 | -L --label labels to use on conflict markers | |
|
146 | -a --text treat all files as text | |
|
147 | -p --print print results instead of overwriting LOCAL | |
|
148 | --no-minimal do not try to minimize conflict regions | |
|
149 | -h --help display help and exit | |
|
150 | -q --quiet suppress output | |
|
151 | [1] | |
|
54 | 152 | |
|
55 | echo '% wrong number of arguments' | |
|
56 | python simplemerge | |
|
153 | bad option | |
|
57 | 154 | |
|
58 | echo '% bad option' | |
|
59 | python simplemerge --foo -p local base other | |
|
60 | ||
|
61 | exit 0 | |
|
155 | $ python simplemerge --foo -p local base other | |
|
156 | simplemerge: option --foo not recognized | |
|
157 | simplemerge [OPTS] LOCAL BASE OTHER | |
|
158 | ||
|
159 | Simple three-way file merge utility with a minimal feature set. | |
|
160 | ||
|
161 | Apply to LOCAL the changes necessary to go from BASE to OTHER. | |
|
162 | ||
|
163 | By default, LOCAL is overwritten with the results of this operation. | |
|
164 | ||
|
165 | options: | |
|
166 | -L --label labels to use on conflict markers | |
|
167 | -a --text treat all files as text | |
|
168 | -p --print print results instead of overwriting LOCAL | |
|
169 | --no-minimal do not try to minimize conflict regions | |
|
170 | -h --help display help and exit | |
|
171 | -q --quiet suppress output | |
|
172 | [1] |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now