##// END OF EJS Templates
test-simplemerge-cmd.t: move all tests into test-contrib.t
Augie Fackler -
r14032:d98af142 default
parent child Browse files
Show More
@@ -103,3 +103,177 b' Compare repos:'
103 103 no changes found
104 104 [1]
105 105
106
107 Test simplemerge command:
108
109 $ cp "$CONTRIBDIR/simplemerge" .
110 $ echo base > base
111 $ echo local > local
112 $ cat base >> local
113 $ cp local orig
114 $ cat base > other
115 $ echo other >> other
116
117 changing local directly
118
119 $ python simplemerge local base other && echo "merge succeeded"
120 merge succeeded
121 $ cat local
122 local
123 base
124 other
125 $ cp orig local
126
127 printing to stdout
128
129 $ python simplemerge -p local base other
130 local
131 base
132 other
133
134 local:
135
136 $ cat local
137 local
138 base
139
140 conflicts
141
142 $ cp base conflict-local
143 $ cp other conflict-other
144 $ echo not other >> conflict-local
145 $ echo end >> conflict-local
146 $ echo end >> conflict-other
147 $ python simplemerge -p conflict-local base conflict-other
148 base
149 <<<<<<< conflict-local
150 not other
151 =======
152 other
153 >>>>>>> conflict-other
154 end
155 warning: conflicts during merge.
156 [1]
157
158 --no-minimal
159
160 $ python simplemerge -p --no-minimal conflict-local base conflict-other
161 base
162 <<<<<<< conflict-local
163 not other
164 end
165 =======
166 other
167 end
168 >>>>>>> conflict-other
169 warning: conflicts during merge.
170 [1]
171
172 1 label
173
174 $ python simplemerge -p -L foo conflict-local base conflict-other
175 base
176 <<<<<<< foo
177 not other
178 =======
179 other
180 >>>>>>> conflict-other
181 end
182 warning: conflicts during merge.
183 [1]
184
185 2 labels
186
187 $ python simplemerge -p -L foo -L bar conflict-local base conflict-other
188 base
189 <<<<<<< foo
190 not other
191 =======
192 other
193 >>>>>>> bar
194 end
195 warning: conflicts during merge.
196 [1]
197
198 too many labels
199
200 $ python simplemerge -p -L foo -L bar -L baz conflict-local base conflict-other
201 abort: can only specify two labels.
202 [255]
203
204 binary file
205
206 $ python -c "f = file('binary-local', 'w'); f.write('\x00'); f.close()"
207 $ cat orig >> binary-local
208 $ python simplemerge -p binary-local base other
209 abort: binary-local looks like a binary file.
210 [255]
211
212 binary file --text
213
214 $ python simplemerge -a -p binary-local base other 2>&1
215 warning: binary-local looks like a binary file.
216 \x00local (esc)
217 base
218 other
219
220 help
221
222 $ python simplemerge --help
223 simplemerge [OPTS] LOCAL BASE OTHER
224
225 Simple three-way file merge utility with a minimal feature set.
226
227 Apply to LOCAL the changes necessary to go from BASE to OTHER.
228
229 By default, LOCAL is overwritten with the results of this operation.
230
231 options:
232 -L --label labels to use on conflict markers
233 -a --text treat all files as text
234 -p --print print results instead of overwriting LOCAL
235 --no-minimal do not try to minimize conflict regions
236 -h --help display help and exit
237 -q --quiet suppress output
238
239 wrong number of arguments
240
241 $ python simplemerge
242 simplemerge: wrong number of arguments
243 simplemerge [OPTS] LOCAL BASE OTHER
244
245 Simple three-way file merge utility with a minimal feature set.
246
247 Apply to LOCAL the changes necessary to go from BASE to OTHER.
248
249 By default, LOCAL is overwritten with the results of this operation.
250
251 options:
252 -L --label labels to use on conflict markers
253 -a --text treat all files as text
254 -p --print print results instead of overwriting LOCAL
255 --no-minimal do not try to minimize conflict regions
256 -h --help display help and exit
257 -q --quiet suppress output
258 [1]
259
260 bad option
261
262 $ python simplemerge --foo -p local base other
263 simplemerge: option --foo not recognized
264 simplemerge [OPTS] LOCAL BASE OTHER
265
266 Simple three-way file merge utility with a minimal feature set.
267
268 Apply to LOCAL the changes necessary to go from BASE to OTHER.
269
270 By default, LOCAL is overwritten with the results of this operation.
271
272 options:
273 -L --label labels to use on conflict markers
274 -a --text treat all files as text
275 -p --print print results instead of overwriting LOCAL
276 --no-minimal do not try to minimize conflict regions
277 -h --help display help and exit
278 -q --quiet suppress output
279 [1]
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now