Show More
@@ -1,772 +1,806 b'' | |||
|
1 | 1 | $ "$TESTDIR/hghave" system-sh || exit 80 |
|
2 | 2 | |
|
3 | 3 | test merge-tools configuration - mostly exercising filemerge.py |
|
4 | 4 | |
|
5 | 5 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with the test |
|
6 | 6 | $ hg init |
|
7 | 7 | |
|
8 | 8 | revision 0 |
|
9 | 9 | |
|
10 | 10 | $ echo "revision 0" > f |
|
11 | 11 | $ echo "space" >> f |
|
12 | 12 | $ hg commit -Am "revision 0" |
|
13 | 13 | adding f |
|
14 | 14 | |
|
15 | 15 | revision 1 |
|
16 | 16 | |
|
17 | 17 | $ echo "revision 1" > f |
|
18 | 18 | $ echo "space" >> f |
|
19 | 19 | $ hg commit -Am "revision 1" |
|
20 | 20 | $ hg update 0 > /dev/null |
|
21 | 21 | |
|
22 | 22 | revision 2 |
|
23 | 23 | |
|
24 | 24 | $ echo "revision 2" > f |
|
25 | 25 | $ echo "space" >> f |
|
26 | 26 | $ hg commit -Am "revision 2" |
|
27 | 27 | created new head |
|
28 | 28 | $ hg update 0 > /dev/null |
|
29 | 29 | |
|
30 | 30 | revision 3 - simple to merge |
|
31 | 31 | |
|
32 | 32 | $ echo "revision 3" >> f |
|
33 | 33 | $ hg commit -Am "revision 3" |
|
34 | 34 | created new head |
|
35 | 35 | $ echo "[merge-tools]" > .hg/hgrc |
|
36 | 36 | |
|
37 | 37 | $ beforemerge() { |
|
38 | 38 | > cat .hg/hgrc |
|
39 | 39 | > echo "# hg update -C 1" |
|
40 | 40 | > hg update -C 1 > /dev/null |
|
41 | 41 | > } |
|
42 | 42 | $ aftermerge() { |
|
43 | 43 | > echo "# cat f" |
|
44 | 44 | > cat f |
|
45 | 45 | > echo "# hg stat" |
|
46 | 46 | > hg stat |
|
47 | 47 | > rm -f f.orig |
|
48 | 48 | > } |
|
49 | $ domerge() { | |
|
50 | > beforemerge | |
|
51 | > echo "# hg merge $*" | |
|
52 | > hg merge $* | |
|
53 | > aftermerge | |
|
54 | > } | |
|
55 | 49 | |
|
56 | 50 | Tool selection |
|
57 | 51 | |
|
58 | 52 | default is internal merge: |
|
59 | 53 | |
|
60 | 54 | $ beforemerge |
|
61 | 55 | [merge-tools] |
|
62 | 56 | # hg update -C 1 |
|
63 | 57 | |
|
64 | 58 | hg merge -r 2 |
|
65 | 59 | override $PATH to ensure hgmerge not visible; use $PYTHON in case we're |
|
66 | 60 | running from a devel copy, not a temp installation |
|
67 | 61 | |
|
68 | 62 | $ PATH="$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
69 | 63 | merging f |
|
70 | 64 | warning: conflicts during merge. |
|
71 | 65 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
72 | 66 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
73 | 67 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
74 | 68 | [1] |
|
75 | 69 | $ aftermerge |
|
76 | 70 | # cat f |
|
77 | 71 | <<<<<<< local |
|
78 | 72 | revision 1 |
|
79 | 73 | ======= |
|
80 | 74 | revision 2 |
|
81 | 75 | >>>>>>> other |
|
82 | 76 | space |
|
83 | 77 | # hg stat |
|
84 | 78 | M f |
|
85 | 79 | ? f.orig |
|
86 | 80 | |
|
87 | 81 | simplest hgrc using false for merge: |
|
88 | 82 | |
|
89 | 83 | $ echo "false.whatever=" >> .hg/hgrc |
|
90 |
$ |
|
|
84 | $ beforemerge | |
|
91 | 85 | [merge-tools] |
|
92 | 86 | false.whatever= |
|
93 | 87 | # hg update -C 1 |
|
94 |
|
|
|
88 | $ hg merge -r 2 | |
|
95 | 89 | merging f |
|
96 | 90 | merging f failed! |
|
97 | 91 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
98 | 92 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
93 | [1] | |
|
94 | $ aftermerge | |
|
99 | 95 | # cat f |
|
100 | 96 | revision 1 |
|
101 | 97 | space |
|
102 | 98 | # hg stat |
|
103 | 99 | M f |
|
104 | 100 | ? f.orig |
|
105 | 101 | |
|
106 | 102 | unexecutable file in $PATH shouldn't be found: |
|
107 | 103 | |
|
108 | 104 | $ touch false |
|
109 | 105 | $ hg up -qC 1 |
|
110 | 106 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
111 | 107 | merging f |
|
112 | 108 | warning: conflicts during merge. |
|
113 | 109 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
114 | 110 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
115 | 111 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
116 | 112 | [1] |
|
117 | 113 | $ rm false |
|
118 | 114 | |
|
119 | 115 | executable directory in $PATH shouldn't be found: |
|
120 | 116 | |
|
121 | 117 | $ mkdir false |
|
122 | 118 | $ hg up -qC 1 |
|
123 | 119 | $ PATH="`pwd`:$BINDIR" $PYTHON "$BINDIR"/hg merge -r 2 |
|
124 | 120 | merging f |
|
125 | 121 | warning: conflicts during merge. |
|
126 | 122 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
127 | 123 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
128 | 124 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
129 | 125 | [1] |
|
130 | 126 | $ rmdir false |
|
131 | 127 | |
|
132 | 128 | true with higher .priority gets precedence: |
|
133 | 129 | |
|
134 | 130 | $ echo "true.priority=1" >> .hg/hgrc |
|
135 |
$ |
|
|
131 | $ beforemerge | |
|
136 | 132 | [merge-tools] |
|
137 | 133 | false.whatever= |
|
138 | 134 | true.priority=1 |
|
139 | 135 | # hg update -C 1 |
|
140 |
|
|
|
136 | $ hg merge -r 2 | |
|
141 | 137 | merging f |
|
142 | 138 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
143 | 139 | (branch merge, don't forget to commit) |
|
140 | $ aftermerge | |
|
144 | 141 | # cat f |
|
145 | 142 | revision 1 |
|
146 | 143 | space |
|
147 | 144 | # hg stat |
|
148 | 145 | M f |
|
149 | 146 | |
|
150 | 147 | unless lowered on command line: |
|
151 | 148 | |
|
152 | $ domerge -r 2 --config merge-tools.true.priority=-7 | |
|
149 | $ beforemerge | |
|
153 | 150 | [merge-tools] |
|
154 | 151 | false.whatever= |
|
155 | 152 | true.priority=1 |
|
156 | 153 | # hg update -C 1 |
|
157 |
|
|
|
154 | $ hg merge -r 2 --config merge-tools.true.priority=-7 | |
|
158 | 155 | merging f |
|
159 | 156 | merging f failed! |
|
160 | 157 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
161 | 158 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
159 | [1] | |
|
160 | $ aftermerge | |
|
162 | 161 | # cat f |
|
163 | 162 | revision 1 |
|
164 | 163 | space |
|
165 | 164 | # hg stat |
|
166 | 165 | M f |
|
167 | 166 | ? f.orig |
|
168 | 167 | |
|
169 | 168 | or false set higher on command line: |
|
170 | 169 | |
|
171 | $ domerge -r 2 --config merge-tools.false.priority=117 | |
|
170 | $ beforemerge | |
|
172 | 171 | [merge-tools] |
|
173 | 172 | false.whatever= |
|
174 | 173 | true.priority=1 |
|
175 | 174 | # hg update -C 1 |
|
176 |
|
|
|
175 | $ hg merge -r 2 --config merge-tools.false.priority=117 | |
|
177 | 176 | merging f |
|
178 | 177 | merging f failed! |
|
179 | 178 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
180 | 179 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
180 | [1] | |
|
181 | $ aftermerge | |
|
181 | 182 | # cat f |
|
182 | 183 | revision 1 |
|
183 | 184 | space |
|
184 | 185 | # hg stat |
|
185 | 186 | M f |
|
186 | 187 | ? f.orig |
|
187 | 188 | |
|
188 | 189 | or true.executable not found in PATH: |
|
189 | 190 | |
|
190 | $ domerge -r 2 --config merge-tools.true.executable=nonexistingmergetool | |
|
191 | $ beforemerge | |
|
191 | 192 | [merge-tools] |
|
192 | 193 | false.whatever= |
|
193 | 194 | true.priority=1 |
|
194 | 195 | # hg update -C 1 |
|
195 |
|
|
|
196 | $ hg merge -r 2 --config merge-tools.true.executable=nonexistingmergetool | |
|
196 | 197 | merging f |
|
197 | 198 | merging f failed! |
|
198 | 199 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
199 | 200 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
201 | [1] | |
|
202 | $ aftermerge | |
|
200 | 203 | # cat f |
|
201 | 204 | revision 1 |
|
202 | 205 | space |
|
203 | 206 | # hg stat |
|
204 | 207 | M f |
|
205 | 208 | ? f.orig |
|
206 | 209 | |
|
207 | 210 | or true.executable with bogus path: |
|
208 | 211 | |
|
209 | $ domerge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool | |
|
212 | $ beforemerge | |
|
210 | 213 | [merge-tools] |
|
211 | 214 | false.whatever= |
|
212 | 215 | true.priority=1 |
|
213 | 216 | # hg update -C 1 |
|
214 |
|
|
|
217 | $ hg merge -r 2 --config merge-tools.true.executable=/nonexisting/mergetool | |
|
215 | 218 | merging f |
|
216 | 219 | merging f failed! |
|
217 | 220 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
218 | 221 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
222 | [1] | |
|
223 | $ aftermerge | |
|
219 | 224 | # cat f |
|
220 | 225 | revision 1 |
|
221 | 226 | space |
|
222 | 227 | # hg stat |
|
223 | 228 | M f |
|
224 | 229 | ? f.orig |
|
225 | 230 | |
|
226 | 231 | but true.executable set to cat found in PATH works: |
|
227 | 232 | |
|
228 | 233 | $ echo "true.executable=cat" >> .hg/hgrc |
|
229 |
$ |
|
|
234 | $ beforemerge | |
|
230 | 235 | [merge-tools] |
|
231 | 236 | false.whatever= |
|
232 | 237 | true.priority=1 |
|
233 | 238 | true.executable=cat |
|
234 | 239 | # hg update -C 1 |
|
235 |
|
|
|
240 | $ hg merge -r 2 | |
|
236 | 241 | merging f |
|
237 | 242 | revision 1 |
|
238 | 243 | space |
|
239 | 244 | revision 0 |
|
240 | 245 | space |
|
241 | 246 | revision 2 |
|
242 | 247 | space |
|
243 | 248 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
244 | 249 | (branch merge, don't forget to commit) |
|
250 | $ aftermerge | |
|
245 | 251 | # cat f |
|
246 | 252 | revision 1 |
|
247 | 253 | space |
|
248 | 254 | # hg stat |
|
249 | 255 | M f |
|
250 | 256 | |
|
251 | 257 | and true.executable set to cat with path works: |
|
252 | 258 | |
|
253 | $ domerge -r 2 --config merge-tools.true.executable=cat | |
|
259 | $ beforemerge | |
|
254 | 260 | [merge-tools] |
|
255 | 261 | false.whatever= |
|
256 | 262 | true.priority=1 |
|
257 | 263 | true.executable=cat |
|
258 | 264 | # hg update -C 1 |
|
259 |
|
|
|
265 | $ hg merge -r 2 --config merge-tools.true.executable=cat | |
|
260 | 266 | merging f |
|
261 | 267 | revision 1 |
|
262 | 268 | space |
|
263 | 269 | revision 0 |
|
264 | 270 | space |
|
265 | 271 | revision 2 |
|
266 | 272 | space |
|
267 | 273 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
268 | 274 | (branch merge, don't forget to commit) |
|
275 | $ aftermerge | |
|
269 | 276 | # cat f |
|
270 | 277 | revision 1 |
|
271 | 278 | space |
|
272 | 279 | # hg stat |
|
273 | 280 | M f |
|
274 | 281 | |
|
275 | 282 | environment variables in true.executable are handled: |
|
276 | 283 | |
|
277 | 284 | $ cat > $HGTMP/merge.sh <<EOF |
|
278 | 285 | > #!/bin/sh |
|
279 | 286 | > echo 'custom merge tool' |
|
280 | 287 | > EOF |
|
281 | 288 | $ chmod +x $HGTMP/merge.sh |
|
282 | $ domerge -r 2 --config merge-tools.true.executable='$HGTMP/merge.sh' | |
|
289 | $ beforemerge | |
|
283 | 290 | [merge-tools] |
|
284 | 291 | false.whatever= |
|
285 | 292 | true.priority=1 |
|
286 | 293 | true.executable=cat |
|
287 | 294 | # hg update -C 1 |
|
288 |
|
|
|
295 | $ hg merge -r 2 --config merge-tools.true.executable=$HGTMP/merge.sh | |
|
289 | 296 | merging f |
|
290 | 297 | custom merge tool |
|
291 | 298 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
292 | 299 | (branch merge, don't forget to commit) |
|
300 | $ aftermerge | |
|
293 | 301 | # cat f |
|
294 | 302 | revision 1 |
|
295 | 303 | space |
|
296 | 304 | # hg stat |
|
297 | 305 | M f |
|
298 | 306 | |
|
299 | 307 | Tool selection and merge-patterns |
|
300 | 308 | |
|
301 | 309 | merge-patterns specifies new tool false: |
|
302 | 310 | |
|
303 | $ domerge -r 2 --config merge-patterns.f=false | |
|
311 | $ beforemerge | |
|
304 | 312 | [merge-tools] |
|
305 | 313 | false.whatever= |
|
306 | 314 | true.priority=1 |
|
307 | 315 | true.executable=cat |
|
308 | 316 | # hg update -C 1 |
|
309 |
|
|
|
317 | $ hg merge -r 2 --config merge-patterns.f=false | |
|
310 | 318 | merging f |
|
311 | 319 | merging f failed! |
|
312 | 320 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
313 | 321 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
322 | [1] | |
|
323 | $ aftermerge | |
|
314 | 324 | # cat f |
|
315 | 325 | revision 1 |
|
316 | 326 | space |
|
317 | 327 | # hg stat |
|
318 | 328 | M f |
|
319 | 329 | ? f.orig |
|
320 | 330 | |
|
321 | 331 | merge-patterns specifies executable not found in PATH and gets warning: |
|
322 | 332 | |
|
323 | $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool | |
|
333 | $ beforemerge | |
|
324 | 334 | [merge-tools] |
|
325 | 335 | false.whatever= |
|
326 | 336 | true.priority=1 |
|
327 | 337 | true.executable=cat |
|
328 | 338 | # hg update -C 1 |
|
329 |
|
|
|
339 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=nonexistingmergetool | |
|
330 | 340 | couldn't find merge tool true specified for f |
|
331 | 341 | merging f |
|
332 | 342 | merging f failed! |
|
333 | 343 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
334 | 344 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
345 | [1] | |
|
346 | $ aftermerge | |
|
335 | 347 | # cat f |
|
336 | 348 | revision 1 |
|
337 | 349 | space |
|
338 | 350 | # hg stat |
|
339 | 351 | M f |
|
340 | 352 | ? f.orig |
|
341 | 353 | |
|
342 | 354 | merge-patterns specifies executable with bogus path and gets warning: |
|
343 | 355 | |
|
344 | $ domerge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool | |
|
356 | $ beforemerge | |
|
345 | 357 | [merge-tools] |
|
346 | 358 | false.whatever= |
|
347 | 359 | true.priority=1 |
|
348 | 360 | true.executable=cat |
|
349 | 361 | # hg update -C 1 |
|
350 |
|
|
|
362 | $ hg merge -r 2 --config merge-patterns.f=true --config merge-tools.true.executable=/nonexisting/mergetool | |
|
351 | 363 | couldn't find merge tool true specified for f |
|
352 | 364 | merging f |
|
353 | 365 | merging f failed! |
|
354 | 366 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
355 | 367 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
368 | [1] | |
|
369 | $ aftermerge | |
|
356 | 370 | # cat f |
|
357 | 371 | revision 1 |
|
358 | 372 | space |
|
359 | 373 | # hg stat |
|
360 | 374 | M f |
|
361 | 375 | ? f.orig |
|
362 | 376 | |
|
363 | 377 | ui.merge overrules priority |
|
364 | 378 | |
|
365 | 379 | ui.merge specifies false: |
|
366 | 380 | |
|
367 | $ domerge -r 2 --config ui.merge=false | |
|
381 | $ beforemerge | |
|
368 | 382 | [merge-tools] |
|
369 | 383 | false.whatever= |
|
370 | 384 | true.priority=1 |
|
371 | 385 | true.executable=cat |
|
372 | 386 | # hg update -C 1 |
|
373 |
|
|
|
387 | $ hg merge -r 2 --config ui.merge=false | |
|
374 | 388 | merging f |
|
375 | 389 | merging f failed! |
|
376 | 390 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
377 | 391 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
392 | [1] | |
|
393 | $ aftermerge | |
|
378 | 394 | # cat f |
|
379 | 395 | revision 1 |
|
380 | 396 | space |
|
381 | 397 | # hg stat |
|
382 | 398 | M f |
|
383 | 399 | ? f.orig |
|
384 | 400 | |
|
385 | 401 | ui.merge specifies internal:fail: |
|
386 | 402 | |
|
387 | $ domerge -r 2 --config ui.merge=internal:fail | |
|
403 | $ beforemerge | |
|
388 | 404 | [merge-tools] |
|
389 | 405 | false.whatever= |
|
390 | 406 | true.priority=1 |
|
391 | 407 | true.executable=cat |
|
392 | 408 | # hg update -C 1 |
|
393 |
|
|
|
409 | $ hg merge -r 2 --config ui.merge=internal:fail | |
|
394 | 410 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
395 | 411 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
412 | [1] | |
|
413 | $ aftermerge | |
|
396 | 414 | # cat f |
|
397 | 415 | revision 1 |
|
398 | 416 | space |
|
399 | 417 | # hg stat |
|
400 | 418 | M f |
|
401 | 419 | |
|
402 | 420 | ui.merge specifies internal:local: |
|
403 | 421 | |
|
404 | $ domerge -r 2 --config ui.merge=internal:local | |
|
422 | $ beforemerge | |
|
405 | 423 | [merge-tools] |
|
406 | 424 | false.whatever= |
|
407 | 425 | true.priority=1 |
|
408 | 426 | true.executable=cat |
|
409 | 427 | # hg update -C 1 |
|
410 |
|
|
|
428 | $ hg merge -r 2 --config ui.merge=internal:local | |
|
411 | 429 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
412 | 430 | (branch merge, don't forget to commit) |
|
431 | $ aftermerge | |
|
413 | 432 | # cat f |
|
414 | 433 | revision 1 |
|
415 | 434 | space |
|
416 | 435 | # hg stat |
|
417 | 436 | M f |
|
418 | 437 | |
|
419 | 438 | ui.merge specifies internal:other: |
|
420 | 439 | |
|
421 | $ domerge -r 2 --config ui.merge=internal:other | |
|
440 | $ beforemerge | |
|
422 | 441 | [merge-tools] |
|
423 | 442 | false.whatever= |
|
424 | 443 | true.priority=1 |
|
425 | 444 | true.executable=cat |
|
426 | 445 | # hg update -C 1 |
|
427 |
|
|
|
446 | $ hg merge -r 2 --config ui.merge=internal:other | |
|
428 | 447 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
429 | 448 | (branch merge, don't forget to commit) |
|
449 | $ aftermerge | |
|
430 | 450 | # cat f |
|
431 | 451 | revision 2 |
|
432 | 452 | space |
|
433 | 453 | # hg stat |
|
434 | 454 | M f |
|
435 | 455 | |
|
436 | 456 | ui.merge specifies internal:prompt: |
|
437 | 457 | |
|
438 | $ domerge -r 2 --config ui.merge=internal:prompt | |
|
458 | $ beforemerge | |
|
439 | 459 | [merge-tools] |
|
440 | 460 | false.whatever= |
|
441 | 461 | true.priority=1 |
|
442 | 462 | true.executable=cat |
|
443 | 463 | # hg update -C 1 |
|
444 |
|
|
|
464 | $ hg merge -r 2 --config ui.merge=internal:prompt | |
|
445 | 465 | no tool found to merge f |
|
446 | 466 | keep (l)ocal or take (o)ther? l |
|
447 | 467 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
448 | 468 | (branch merge, don't forget to commit) |
|
469 | $ aftermerge | |
|
449 | 470 | # cat f |
|
450 | 471 | revision 1 |
|
451 | 472 | space |
|
452 | 473 | # hg stat |
|
453 | 474 | M f |
|
454 | 475 | |
|
455 | 476 | ui.merge specifies internal:dump: |
|
456 | 477 | |
|
457 | $ domerge -r 2 --config ui.merge=internal:dump | |
|
478 | $ beforemerge | |
|
458 | 479 | [merge-tools] |
|
459 | 480 | false.whatever= |
|
460 | 481 | true.priority=1 |
|
461 | 482 | true.executable=cat |
|
462 | 483 | # hg update -C 1 |
|
463 |
|
|
|
484 | $ hg merge -r 2 --config ui.merge=internal:dump | |
|
464 | 485 | merging f |
|
465 | 486 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
466 | 487 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
488 | [1] | |
|
489 | $ aftermerge | |
|
467 | 490 | # cat f |
|
468 | 491 | revision 1 |
|
469 | 492 | space |
|
470 | 493 | # hg stat |
|
471 | 494 | M f |
|
472 | 495 | ? f.base |
|
473 | 496 | ? f.local |
|
474 | 497 | ? f.orig |
|
475 | 498 | ? f.other |
|
476 | 499 | |
|
477 | 500 | f.base: |
|
478 | 501 | |
|
479 | 502 | $ cat f.base |
|
480 | 503 | revision 0 |
|
481 | 504 | space |
|
482 | 505 | |
|
483 | 506 | f.local: |
|
484 | 507 | |
|
485 | 508 | $ cat f.local |
|
486 | 509 | revision 1 |
|
487 | 510 | space |
|
488 | 511 | |
|
489 | 512 | f.other: |
|
490 | 513 | |
|
491 | 514 | $ cat f.other |
|
492 | 515 | revision 2 |
|
493 | 516 | space |
|
494 | 517 | $ rm f.base f.local f.other |
|
495 | 518 | |
|
496 | 519 | ui.merge specifies internal:other but is overruled by pattern for false: |
|
497 | 520 | |
|
498 | $ domerge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false | |
|
521 | $ beforemerge | |
|
499 | 522 | [merge-tools] |
|
500 | 523 | false.whatever= |
|
501 | 524 | true.priority=1 |
|
502 | 525 | true.executable=cat |
|
503 | 526 | # hg update -C 1 |
|
504 |
|
|
|
527 | $ hg merge -r 2 --config ui.merge=internal:other --config merge-patterns.f=false | |
|
505 | 528 | merging f |
|
506 | 529 | merging f failed! |
|
507 | 530 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
508 | 531 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
532 | [1] | |
|
533 | $ aftermerge | |
|
509 | 534 | # cat f |
|
510 | 535 | revision 1 |
|
511 | 536 | space |
|
512 | 537 | # hg stat |
|
513 | 538 | M f |
|
514 | 539 | ? f.orig |
|
515 | 540 | |
|
516 | 541 | Premerge |
|
517 | 542 | |
|
518 | 543 | ui.merge specifies internal:other but is overruled by --tool=false |
|
519 | 544 | |
|
520 | $ domerge -r 2 --config ui.merge=internal:other --tool=false | |
|
545 | $ beforemerge | |
|
521 | 546 | [merge-tools] |
|
522 | 547 | false.whatever= |
|
523 | 548 | true.priority=1 |
|
524 | 549 | true.executable=cat |
|
525 | 550 | # hg update -C 1 |
|
526 |
|
|
|
551 | $ hg merge -r 2 --config ui.merge=internal:other --tool=false | |
|
527 | 552 | merging f |
|
528 | 553 | merging f failed! |
|
529 | 554 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
530 | 555 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
556 | [1] | |
|
557 | $ aftermerge | |
|
531 | 558 | # cat f |
|
532 | 559 | revision 1 |
|
533 | 560 | space |
|
534 | 561 | # hg stat |
|
535 | 562 | M f |
|
536 | 563 | ? f.orig |
|
537 | 564 | |
|
538 | 565 | HGMERGE specifies internal:other but is overruled by --tool=false |
|
539 | 566 | |
|
540 | 567 | $ HGMERGE=internal:other ; export HGMERGE |
|
541 | $ domerge -r 2 --tool=false | |
|
568 | $ beforemerge | |
|
542 | 569 | [merge-tools] |
|
543 | 570 | false.whatever= |
|
544 | 571 | true.priority=1 |
|
545 | 572 | true.executable=cat |
|
546 | 573 | # hg update -C 1 |
|
547 |
|
|
|
574 | $ hg merge -r 2 --tool=false | |
|
548 | 575 | merging f |
|
549 | 576 | merging f failed! |
|
550 | 577 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
551 | 578 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
579 | [1] | |
|
580 | $ aftermerge | |
|
552 | 581 | # cat f |
|
553 | 582 | revision 1 |
|
554 | 583 | space |
|
555 | 584 | # hg stat |
|
556 | 585 | M f |
|
557 | 586 | ? f.orig |
|
558 | 587 | |
|
559 | 588 | $ unset HGMERGE # make sure HGMERGE doesn't interfere with remaining tests |
|
560 | 589 | |
|
561 | 590 | Default is silent simplemerge: |
|
562 | 591 | |
|
563 |
$ |
|
|
592 | $ beforemerge | |
|
564 | 593 | [merge-tools] |
|
565 | 594 | false.whatever= |
|
566 | 595 | true.priority=1 |
|
567 | 596 | true.executable=cat |
|
568 | 597 | # hg update -C 1 |
|
569 |
|
|
|
598 | $ hg merge -r 3 | |
|
570 | 599 | merging f |
|
571 | 600 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
572 | 601 | (branch merge, don't forget to commit) |
|
602 | $ aftermerge | |
|
573 | 603 | # cat f |
|
574 | 604 | revision 1 |
|
575 | 605 | space |
|
576 | 606 | revision 3 |
|
577 | 607 | # hg stat |
|
578 | 608 | M f |
|
579 | 609 | |
|
580 | 610 | .premerge=True is same: |
|
581 | 611 | |
|
582 | $ domerge -r 3 --config merge-tools.true.premerge=True | |
|
612 | $ beforemerge | |
|
583 | 613 | [merge-tools] |
|
584 | 614 | false.whatever= |
|
585 | 615 | true.priority=1 |
|
586 | 616 | true.executable=cat |
|
587 | 617 | # hg update -C 1 |
|
588 |
|
|
|
618 | $ hg merge -r 3 --config merge-tools.true.premerge=True | |
|
589 | 619 | merging f |
|
590 | 620 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
591 | 621 | (branch merge, don't forget to commit) |
|
622 | $ aftermerge | |
|
592 | 623 | # cat f |
|
593 | 624 | revision 1 |
|
594 | 625 | space |
|
595 | 626 | revision 3 |
|
596 | 627 | # hg stat |
|
597 | 628 | M f |
|
598 | 629 | |
|
599 | 630 | .premerge=False executes merge-tool: |
|
600 | 631 | |
|
601 | $ domerge -r 3 --config merge-tools.true.premerge=False | |
|
632 | $ beforemerge | |
|
602 | 633 | [merge-tools] |
|
603 | 634 | false.whatever= |
|
604 | 635 | true.priority=1 |
|
605 | 636 | true.executable=cat |
|
606 | 637 | # hg update -C 1 |
|
607 |
|
|
|
638 | $ hg merge -r 3 --config merge-tools.true.premerge=False | |
|
608 | 639 | merging f |
|
609 | 640 | revision 1 |
|
610 | 641 | space |
|
611 | 642 | revision 0 |
|
612 | 643 | space |
|
613 | 644 | revision 0 |
|
614 | 645 | space |
|
615 | 646 | revision 3 |
|
616 | 647 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
617 | 648 | (branch merge, don't forget to commit) |
|
649 | $ aftermerge | |
|
618 | 650 | # cat f |
|
619 | 651 | revision 1 |
|
620 | 652 | space |
|
621 | 653 | # hg stat |
|
622 | 654 | M f |
|
623 | 655 | |
|
624 | 656 | Tool execution |
|
625 | 657 | |
|
626 | 658 | set tools.args explicit to include $base $local $other $output: |
|
627 | 659 | |
|
628 | 660 | $ beforemerge |
|
629 | 661 | [merge-tools] |
|
630 | 662 | false.whatever= |
|
631 | 663 | true.priority=1 |
|
632 | 664 | true.executable=cat |
|
633 | 665 | # hg update -C 1 |
|
634 | 666 | $ hg merge -r 2 --config merge-tools.true.executable=head --config merge-tools.true.args='$base $local $other $output' \ |
|
635 | 667 | > | sed 's,==> .* <==,==> ... <==,g' |
|
636 | 668 | merging f |
|
637 | 669 | ==> ... <== |
|
638 | 670 | revision 0 |
|
639 | 671 | space |
|
640 | 672 | |
|
641 | 673 | ==> ... <== |
|
642 | 674 | revision 1 |
|
643 | 675 | space |
|
644 | 676 | |
|
645 | 677 | ==> ... <== |
|
646 | 678 | revision 2 |
|
647 | 679 | space |
|
648 | 680 | |
|
649 | 681 | ==> ... <== |
|
650 | 682 | revision 1 |
|
651 | 683 | space |
|
652 | 684 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
653 | 685 | (branch merge, don't forget to commit) |
|
654 | 686 | $ aftermerge |
|
655 | 687 | # cat f |
|
656 | 688 | revision 1 |
|
657 | 689 | space |
|
658 | 690 | # hg stat |
|
659 | 691 | M f |
|
660 | 692 | |
|
661 | 693 | Merge with "echo mergeresult > $local": |
|
662 | 694 | |
|
663 | 695 | $ beforemerge |
|
664 | 696 | [merge-tools] |
|
665 | 697 | false.whatever= |
|
666 | 698 | true.priority=1 |
|
667 | 699 | true.executable=cat |
|
668 | 700 | # hg update -C 1 |
|
669 | 701 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $local' |
|
670 | 702 | merging f |
|
671 | 703 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
672 | 704 | (branch merge, don't forget to commit) |
|
673 | 705 | $ aftermerge |
|
674 | 706 | # cat f |
|
675 | 707 | mergeresult |
|
676 | 708 | # hg stat |
|
677 | 709 | M f |
|
678 | 710 | |
|
679 | 711 | - and $local is the file f: |
|
680 | 712 | |
|
681 | 713 | $ beforemerge |
|
682 | 714 | [merge-tools] |
|
683 | 715 | false.whatever= |
|
684 | 716 | true.priority=1 |
|
685 | 717 | true.executable=cat |
|
686 | 718 | # hg update -C 1 |
|
687 | 719 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > f' |
|
688 | 720 | merging f |
|
689 | 721 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
690 | 722 | (branch merge, don't forget to commit) |
|
691 | 723 | $ aftermerge |
|
692 | 724 | # cat f |
|
693 | 725 | mergeresult |
|
694 | 726 | # hg stat |
|
695 | 727 | M f |
|
696 | 728 | |
|
697 | 729 | Merge with "echo mergeresult > $output" - the variable is a bit magic: |
|
698 | 730 | |
|
699 | 731 | $ beforemerge |
|
700 | 732 | [merge-tools] |
|
701 | 733 | false.whatever= |
|
702 | 734 | true.priority=1 |
|
703 | 735 | true.executable=cat |
|
704 | 736 | # hg update -C 1 |
|
705 | 737 | $ hg merge -r 2 --config merge-tools.true.executable=echo --config merge-tools.true.args='mergeresult > $output' |
|
706 | 738 | merging f |
|
707 | 739 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
708 | 740 | (branch merge, don't forget to commit) |
|
709 | 741 | $ aftermerge |
|
710 | 742 | # cat f |
|
711 | 743 | mergeresult |
|
712 | 744 | # hg stat |
|
713 | 745 | M f |
|
714 | 746 | |
|
715 | 747 | Merge using tool with a path that must be quoted: |
|
716 | 748 | |
|
717 | 749 | $ beforemerge |
|
718 | 750 | [merge-tools] |
|
719 | 751 | false.whatever= |
|
720 | 752 | true.priority=1 |
|
721 | 753 | true.executable=cat |
|
722 | 754 | # hg update -C 1 |
|
723 | 755 | $ cat <<EOF > 'my merge tool' |
|
724 | 756 | > #!/bin/sh |
|
725 | 757 | > cat "\$1" "\$2" "\$3" > "\$4" |
|
726 | 758 | > EOF |
|
727 | 759 | $ chmod +x 'my merge tool' |
|
728 | 760 | $ hg merge -r 2 --config merge-tools.true.executable='./my merge tool' --config merge-tools.true.args='$base $local $other $output' |
|
729 | 761 | merging f |
|
730 | 762 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
731 | 763 | (branch merge, don't forget to commit) |
|
732 | 764 | $ rm -f 'my merge tool' |
|
733 | 765 | $ aftermerge |
|
734 | 766 | # cat f |
|
735 | 767 | revision 0 |
|
736 | 768 | space |
|
737 | 769 | revision 1 |
|
738 | 770 | space |
|
739 | 771 | revision 2 |
|
740 | 772 | space |
|
741 | 773 | # hg stat |
|
742 | 774 | M f |
|
743 | 775 | |
|
744 | 776 | Merge post-processing |
|
745 | 777 | |
|
746 | 778 | cat is a bad merge-tool and doesn't change: |
|
747 | 779 | |
|
748 | $ domerge -y -r 2 --config merge-tools.true.checkchanged=1 | |
|
780 | $ beforemerge | |
|
749 | 781 | [merge-tools] |
|
750 | 782 | false.whatever= |
|
751 | 783 | true.priority=1 |
|
752 | 784 | true.executable=cat |
|
753 | 785 | # hg update -C 1 |
|
754 |
|
|
|
786 | $ hg merge -y -r 2 --config merge-tools.true.checkchanged=1 | |
|
755 | 787 | merging f |
|
756 | 788 | revision 1 |
|
757 | 789 | space |
|
758 | 790 | revision 0 |
|
759 | 791 | space |
|
760 | 792 | revision 2 |
|
761 | 793 | space |
|
762 | 794 | output file f appears unchanged |
|
763 | 795 | was merge successful (yn)? n |
|
764 | 796 | merging f failed! |
|
765 | 797 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
|
766 | 798 | use 'hg resolve' to retry unresolved file merges or 'hg update -C .' to abandon |
|
799 | [1] | |
|
800 | $ aftermerge | |
|
767 | 801 | # cat f |
|
768 | 802 | revision 1 |
|
769 | 803 | space |
|
770 | 804 | # hg stat |
|
771 | 805 | M f |
|
772 | 806 | ? f.orig |
General Comments 0
You need to be logged in to leave comments.
Login now