##// END OF EJS Templates
tests: update test-copies-chain-merge.t to not use empty files...
Martin von Zweigbergk -
r46232:0627cd03 default
parent child Browse files
Show More
@@ -1,978 +1,983
1 1 #testcases filelog compatibility sidedata
2 2
3 3 =====================================================
4 4 Test Copy tracing for chain of copies involving merge
5 5 =====================================================
6 6
7 7 This test files covers copies/rename case for a chains of commit where merges
8 8 are involved. It cheks we do not have unwanted update of behavior and that the
9 9 different options to retrieve copies behave correctly.
10 10
11 11
12 12 Setup
13 13 =====
14 14
15 15 use git diff to see rename
16 16
17 17 $ cat << EOF >> $HGRCPATH
18 18 > [diff]
19 19 > git=yes
20 20 > [ui]
21 21 > logtemplate={rev} {desc}\n
22 22 > EOF
23 23
24 24 #if compatibility
25 25 $ cat >> $HGRCPATH << EOF
26 26 > [experimental]
27 27 > copies.read-from = compatibility
28 28 > EOF
29 29 #endif
30 30
31 31 #if sidedata
32 32 $ cat >> $HGRCPATH << EOF
33 33 > [format]
34 34 > exp-use-side-data = yes
35 35 > exp-use-copies-side-data-changeset = yes
36 36 > EOF
37 37 #endif
38 38
39 39
40 40 $ hg init repo-chain
41 41 $ cd repo-chain
42 42
43 43 Add some linear rename initialy
44 44
45 $ touch a b h
45 $ echo a > a
46 $ echo b > b
47 $ echo h > h
46 48 $ hg ci -Am 'i-0 initial commit: a b h'
47 49 adding a
48 50 adding b
49 51 adding h
50 52 $ hg mv a c
51 53 $ hg ci -Am 'i-1: a -move-> c'
52 54 $ hg mv c d
53 55 $ hg ci -Am 'i-2: c -move-> d'
54 56 $ hg log -G
55 57 @ 2 i-2: c -move-> d
56 58 |
57 59 o 1 i-1: a -move-> c
58 60 |
59 61 o 0 i-0 initial commit: a b h
60 62
61 63
62 64 And having another branch with renames on the other side
63 65
64 66 $ hg mv d e
65 67 $ hg ci -Am 'a-1: d -move-> e'
66 68 $ hg mv e f
67 69 $ hg ci -Am 'a-2: e -move-> f'
68 70 $ hg log -G --rev '::.'
69 71 @ 4 a-2: e -move-> f
70 72 |
71 73 o 3 a-1: d -move-> e
72 74 |
73 75 o 2 i-2: c -move-> d
74 76 |
75 77 o 1 i-1: a -move-> c
76 78 |
77 79 o 0 i-0 initial commit: a b h
78 80
79 81
80 82 Have a branching with nothing on one side
81 83
82 84 $ hg up 'desc("i-2")'
83 85 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
84 86 $ echo foo > b
85 87 $ hg ci -m 'b-1: b update'
86 88 created new head
87 89 $ hg log -G --rev '::.'
88 90 @ 5 b-1: b update
89 91 |
90 92 o 2 i-2: c -move-> d
91 93 |
92 94 o 1 i-1: a -move-> c
93 95 |
94 96 o 0 i-0 initial commit: a b h
95 97
96 98
97 99 Create a branch that delete a file previous renamed
98 100
99 101 $ hg up 'desc("i-2")'
100 102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
101 103 $ hg rm d
102 104 $ hg ci -m 'c-1 delete d'
103 105 created new head
104 106 $ hg log -G --rev '::.'
105 107 @ 6 c-1 delete d
106 108 |
107 109 o 2 i-2: c -move-> d
108 110 |
109 111 o 1 i-1: a -move-> c
110 112 |
111 113 o 0 i-0 initial commit: a b h
112 114
113 115
114 116 Create a branch that delete a file previous renamed and recreate it
115 117
116 118 $ hg up 'desc("i-2")'
117 119 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
118 120 $ hg rm d
119 121 $ hg ci -m 'd-1 delete d'
120 122 created new head
121 123 $ echo bar > d
122 124 $ hg add d
123 125 $ hg ci -m 'd-2 re-add d'
124 126 $ hg log -G --rev '::.'
125 127 @ 8 d-2 re-add d
126 128 |
127 129 o 7 d-1 delete d
128 130 |
129 131 o 2 i-2: c -move-> d
130 132 |
131 133 o 1 i-1: a -move-> c
132 134 |
133 135 o 0 i-0 initial commit: a b h
134 136
135 137
136 138 Having another branch renaming a different file to the same filename as another
137 139
138 140 $ hg up 'desc("i-2")'
139 141 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
140 142 $ hg mv b g
141 143 $ hg ci -m 'e-1 b -move-> g'
142 144 created new head
143 145 $ hg mv g f
144 146 $ hg ci -m 'e-2 g -move-> f'
145 147 $ hg log -G --rev '::.'
146 148 @ 10 e-2 g -move-> f
147 149 |
148 150 o 9 e-1 b -move-> g
149 151 |
150 152 o 2 i-2: c -move-> d
151 153 |
152 154 o 1 i-1: a -move-> c
153 155 |
154 156 o 0 i-0 initial commit: a b h
155 157
156 158
157 159 merging with unrelated change does not interfere with the renames
158 160 ---------------------------------------------------------------
159 161
160 162 - rename on one side
161 163 - unrelated change on the other side
162 164
163 165 $ hg up 'desc("b-1")'
164 166 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
165 167 $ hg merge 'desc("a-2")'
166 168 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
167 169 (branch merge, don't forget to commit)
168 170 $ hg ci -m 'mBAm-0 simple merge - one way'
169 171 $ hg up 'desc("a-2")'
170 172 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
171 173 $ hg merge 'desc("b-1")'
172 174 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
173 175 (branch merge, don't forget to commit)
174 176 $ hg ci -m 'mABm-0 simple merge - the other way'
175 177 created new head
176 178 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
177 179 @ 12 mABm-0 simple merge - the other way
178 180 |\
179 181 +---o 11 mBAm-0 simple merge - one way
180 182 | |/
181 183 | o 5 b-1: b update
182 184 | |
183 185 o | 4 a-2: e -move-> f
184 186 | |
185 187 o | 3 a-1: d -move-> e
186 188 |/
187 189 o 2 i-2: c -move-> d
188 190 |
189 191 o 1 i-1: a -move-> c
190 192 |
191 193 o 0 i-0 initial commit: a b h
192 194
193 195
194 196 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
195 197 A f
196 198 d
197 199 R d
198 200 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
199 201 A f
200 202 d
201 203 R d
202 204 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
203 205 M b
204 206 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
205 207 M b
206 208 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
207 209 M b
208 210 A f
209 211 d
210 212 R d
211 213 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
212 214 M b
213 215 A f
214 216 d
215 217 R d
216 218 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
217 219 M b
218 220 A f
219 221 a
220 222 R a
221 223 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
222 224 M b
223 225 A f
224 226 a
225 227 R a
226 228
227 229 merging with the side having a delete
228 230 -------------------------------------
229 231
230 232 case summary:
231 233 - one with change to an unrelated file
232 234 - one deleting the change
233 235 and recreate an unrelated file after the merge
234 236
235 237 $ hg up 'desc("b-1")'
236 238 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
237 239 $ hg merge 'desc("c-1")'
238 240 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
239 241 (branch merge, don't forget to commit)
240 242 $ hg ci -m 'mBCm-0 simple merge - one way'
241 243 $ echo bar > d
242 244 $ hg add d
243 245 $ hg ci -m 'mBCm-1 re-add d'
244 246 $ hg up 'desc("c-1")'
245 247 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
246 248 $ hg merge 'desc("b-1")'
247 249 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
248 250 (branch merge, don't forget to commit)
249 251 $ hg ci -m 'mCBm-0 simple merge - the other way'
250 252 created new head
251 253 $ echo bar > d
252 254 $ hg add d
253 255 $ hg ci -m 'mCBm-1 re-add d'
254 256 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
255 257 @ 16 mCBm-1 re-add d
256 258 |
257 259 o 15 mCBm-0 simple merge - the other way
258 260 |\
259 261 | | o 14 mBCm-1 re-add d
260 262 | | |
261 263 +---o 13 mBCm-0 simple merge - one way
262 264 | |/
263 265 | o 6 c-1 delete d
264 266 | |
265 267 o | 5 b-1: b update
266 268 |/
267 269 o 2 i-2: c -move-> d
268 270 |
269 271 o 1 i-1: a -move-> c
270 272 |
271 273 o 0 i-0 initial commit: a b h
272 274
273 275 - comparing from the merge
274 276
275 277 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
276 278 R d
277 279 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
278 280 R d
279 281 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
280 282 M b
281 283 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
282 284 M b
283 285 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
284 286 M b
285 287 R d
286 288 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
287 289 M b
288 290 R d
289 291 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
290 292 M b
291 293 R a
292 294 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
293 295 M b
294 296 R a
295 297
296 298 - comparing with the merge children re-adding the file
297 299
298 300 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
299 301 M d
300 302 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
301 303 M d
302 304 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
303 305 M b
304 306 A d
305 307 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
306 308 M b
307 309 A d
308 310 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
309 311 M b
310 312 M d
311 313 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
312 314 M b
313 315 M d
314 316 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
315 317 M b
316 318 A d
317 319 R a
318 320 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
319 321 M b
320 322 A d
321 323 R a
322 324
323 325 Comparing with a merge re-adding the file afterward
324 326 ---------------------------------------------------
325 327
326 328 Merge:
327 329 - one with change to an unrelated file
328 330 - one deleting and recreating the change
329 331
330 332 $ hg up 'desc("b-1")'
331 333 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
332 334 $ hg merge 'desc("d-2")'
333 335 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
334 336 (branch merge, don't forget to commit)
335 337 $ hg ci -m 'mBDm-0 simple merge - one way'
336 338 $ hg up 'desc("d-2")'
337 339 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
338 340 $ hg merge 'desc("b-1")'
339 341 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
340 342 (branch merge, don't forget to commit)
341 343 $ hg ci -m 'mDBm-0 simple merge - the other way'
342 344 created new head
343 345 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
344 346 @ 18 mDBm-0 simple merge - the other way
345 347 |\
346 348 +---o 17 mBDm-0 simple merge - one way
347 349 | |/
348 350 | o 8 d-2 re-add d
349 351 | |
350 352 | o 7 d-1 delete d
351 353 | |
352 354 o | 5 b-1: b update
353 355 |/
354 356 o 2 i-2: c -move-> d
355 357 |
356 358 o 1 i-1: a -move-> c
357 359 |
358 360 o 0 i-0 initial commit: a b h
359 361
360 362 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
361 363 M d
362 364 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
363 365 M d
364 366 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
365 367 M b
366 368 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
367 369 M b
368 370 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
369 371 M b
370 372 M d
371 373 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
372 374 M b
373 375 M d
374 376
375 377 The bugs makes recorded copy is different depending of where we started the merge from since
376 378
377 379 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
378 380 b004912a8510032a0350a74daa2803dadfb00e12 644 d
379 381 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
380 382 b004912a8510032a0350a74daa2803dadfb00e12 644 d
381 383
382 384 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
383 385 b004912a8510032a0350a74daa2803dadfb00e12 644 d
384 386 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
385 01c2f5eabdc4ce2bdee42b5f86311955e6c8f573 644 d
387 169be882533bc917905d46c0c951aa9a1e288dcf 644 d
386 388 $ hg debugindex d
387 389 rev linkrev nodeid p1 p2
388 0 2 01c2f5eabdc4 000000000000 000000000000
390 0 2 169be882533b 000000000000 000000000000
389 391 1 8 b004912a8510 000000000000 000000000000
390 392
391 393 Log output should not include a merge commit as it did not happen
392 394
393 395 $ hg log -Gfr 'desc("mBDm-0")' d
394 396 o 8 d-2 re-add d
395 397 |
396 398 ~
397 399
398 400 $ hg log -Gfr 'desc("mDBm-0")' d
399 401 o 8 d-2 re-add d
400 402 |
401 403 ~
402 404
403 405 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
404 406 M b
405 407 A d
406 408 R a
407 409 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
408 410 M b
409 411 A d
410 412 R a
411 413
412 414
413 415 Comparing with a merge with colliding rename
414 416 --------------------------------------------
415 417
416 418 - the "e-" branch renaming b to f (through 'g')
417 419 - the "a-" branch renaming d to f (through e)
418 420
419 421 $ hg up 'desc("a-2")'
420 422 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
421 $ hg merge 'desc("e-2")'
423 $ hg merge 'desc("e-2")' --tool :union
424 merging f
422 425 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
423 426 (branch merge, don't forget to commit)
424 427 $ hg ci -m 'mAEm-0 simple merge - one way'
425 428 $ hg up 'desc("e-2")'
426 429 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
427 $ hg merge 'desc("a-2")'
430 $ hg merge 'desc("a-2")' --tool :union
431 merging f
428 432 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
429 433 (branch merge, don't forget to commit)
430 434 $ hg ci -m 'mEAm-0 simple merge - the other way'
431 435 created new head
432 436 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
433 437 @ 20 mEAm-0 simple merge - the other way
434 438 |\
435 439 +---o 19 mAEm-0 simple merge - one way
436 440 | |/
437 441 | o 10 e-2 g -move-> f
438 442 | |
439 443 | o 9 e-1 b -move-> g
440 444 | |
441 445 o | 4 a-2: e -move-> f
442 446 | |
443 447 o | 3 a-1: d -move-> e
444 448 |/
445 449 o 2 i-2: c -move-> d
446 450 |
447 451 o 1 i-1: a -move-> c
448 452 |
449 453 o 0 i-0 initial commit: a b h
450 454
451 455 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
452 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
456 c39c6083dad048d5138618a46f123e2f397f4f18 644 f
453 457 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
454 eb806e34ef6be4c264effd5933d31004ad15a793 644 f
458 a9a8bc3860c9d8fa5f2f7e6ea8d40498322737fd 644 f
455 459 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
456 0dd616bc7ab1a111921d95d76f69cda5c2ac539c 644 f
460 263ea25e220aaeb7b9bac551c702037849aa75e8 644 f
457 461 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
458 6da5a2eecb9c833f830b67a4972366d49a9a142c 644 f
462 71b9b7e73d973572ade6dd765477fcee6890e8b1 644 f
459 463 $ hg debugindex f
460 464 rev linkrev nodeid p1 p2
461 0 4 0dd616bc7ab1 000000000000 000000000000
462 1 10 6da5a2eecb9c 000000000000 000000000000
463 2 19 eb806e34ef6b 0dd616bc7ab1 6da5a2eecb9c
465 0 4 263ea25e220a 000000000000 000000000000
466 1 10 71b9b7e73d97 000000000000 000000000000
467 2 19 c39c6083dad0 263ea25e220a 71b9b7e73d97
468 3 20 a9a8bc3860c9 71b9b7e73d97 263ea25e220a
464 469
465 470 # Here the filelog based implementation is not looking at the rename
466 471 # information (because the file exist on both side). However the changelog
467 472 # based on works fine. We have different output.
468 473
469 474 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
470 475 M f
471 476 b (no-filelog !)
472 477 R b
473 478 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
474 479 M f
475 480 b (no-filelog !)
476 481 R b
477 482 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
478 483 M f
479 484 d (no-filelog !)
480 485 R d
481 486 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
482 487 M f
483 488 d (no-filelog !)
484 489 R d
485 490 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
486 491 A f
487 492 d
488 493 R d
489 494 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
490 495 A f
491 496 b
492 497 R b
493 498
494 499 # From here, we run status against revision where both source file exists.
495 500 #
496 501 # The filelog based implementation picks an arbitrary side based on revision
497 502 # numbers. So the same side "wins" whatever the parents order is. This is
498 503 # sub-optimal because depending on revision numbers means the result can be
499 504 # different from one repository to the next.
500 505 #
501 506 # The changeset based algorithm use the parent order to break tie on conflicting
502 507 # information and will have a different order depending on who is p1 and p2.
503 508 # That order is stable accross repositories. (data from p1 prevails)
504 509
505 510 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
506 511 A f
507 512 d
508 513 R b
509 514 R d
510 515 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
511 516 A f
512 517 d (filelog !)
513 518 b (no-filelog !)
514 519 R b
515 520 R d
516 521 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
517 522 A f
518 523 a
519 524 R a
520 525 R b
521 526 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
522 527 A f
523 528 a (filelog !)
524 529 b (no-filelog !)
525 530 R a
526 531 R b
527 532
528 533
529 534 Note:
530 535 | In this case, one of the merge wrongly record a merge while there is none.
531 536 | This lead to bad copy tracing information to be dug up.
532 537
533 538
534 539 Merge:
535 540 - one with change to an unrelated file (b)
536 541 - one overwriting a file (d) with a rename (from h to i to d)
537 542
538 543 $ hg up 'desc("i-2")'
539 544 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
540 545 $ hg mv h i
541 546 $ hg commit -m "f-1: rename h -> i"
542 547 created new head
543 548 $ hg mv --force i d
544 549 $ hg commit -m "f-2: rename i -> d"
545 550 $ hg debugindex d
546 551 rev linkrev nodeid p1 p2
547 0 2 01c2f5eabdc4 000000000000 000000000000
552 0 2 169be882533b 000000000000 000000000000
548 553 1 8 b004912a8510 000000000000 000000000000
549 2 22 c72365ee036f 000000000000 000000000000
554 2 22 4a067cf8965d 000000000000 000000000000
550 555 $ hg up 'desc("b-1")'
551 556 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
552 557 $ hg merge 'desc("f-2")'
553 558 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
554 559 (branch merge, don't forget to commit)
555 560 $ hg ci -m 'mBFm-0 simple merge - one way'
556 561 $ hg up 'desc("f-2")'
557 562 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
558 563 $ hg merge 'desc("b-1")'
559 564 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
560 565 (branch merge, don't forget to commit)
561 566 $ hg ci -m 'mFBm-0 simple merge - the other way'
562 567 created new head
563 568 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
564 569 @ 24 mFBm-0 simple merge - the other way
565 570 |\
566 571 +---o 23 mBFm-0 simple merge - one way
567 572 | |/
568 573 | o 22 f-2: rename i -> d
569 574 | |
570 575 | o 21 f-1: rename h -> i
571 576 | |
572 577 o | 5 b-1: b update
573 578 |/
574 579 o 2 i-2: c -move-> d
575 580 |
576 581 o 1 i-1: a -move-> c
577 582 |
578 583 o 0 i-0 initial commit: a b h
579 584
580 585 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
581 586 M b
582 587 A d
583 588 h
584 589 R a
585 590 R h
586 591 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
587 592 M b
588 593 A d
589 594 h
590 595 R a
591 596 R h
592 597 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
593 598 M d
594 599 h (no-filelog !)
595 600 R h
596 601 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
597 602 M b
598 603 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
599 604 M b
600 605 M d
601 606 i (no-filelog !)
602 607 R i
603 608 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
604 609 M d
605 610 h (no-filelog !)
606 611 R h
607 612 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
608 613 M b
609 614 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
610 615 M b
611 616 M d
612 617 i (no-filelog !)
613 618 R i
614 619
615 620 $ hg log -Gfr 'desc("mBFm-0")' d
616 621 o 22 f-2: rename i -> d
617 622 |
618 623 o 21 f-1: rename h -> i
619 624 :
620 625 o 0 i-0 initial commit: a b h
621 626
622 627
623 628 $ hg log -Gfr 'desc("mFBm-0")' d
624 629 o 22 f-2: rename i -> d
625 630 |
626 631 o 21 f-1: rename h -> i
627 632 :
628 633 o 0 i-0 initial commit: a b h
629 634
630 635
631 636
632 637 Merge:
633 638 - one with change to a file
634 639 - one deleting and recreating the file
635 640
636 641 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
637 642 consider history and rename on both branch of the merge.
638 643
639 644 $ hg up 'desc("i-2")'
640 645 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
641 646 $ echo "some update" >> d
642 647 $ hg commit -m "g-1: update d"
643 648 created new head
644 649 $ hg up 'desc("d-2")'
645 650 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
646 651 $ hg merge 'desc("g-1")' --tool :union
647 652 merging d
648 653 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
649 654 (branch merge, don't forget to commit)
650 655 $ hg ci -m 'mDGm-0 simple merge - one way'
651 656 $ hg up 'desc("g-1")'
652 657 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
653 658 $ hg merge 'desc("d-2")' --tool :union
654 659 merging d
655 660 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
656 661 (branch merge, don't forget to commit)
657 662 $ hg ci -m 'mGDm-0 simple merge - the other way'
658 663 created new head
659 664 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
660 665 @ 27 mGDm-0 simple merge - the other way
661 666 |\
662 667 +---o 26 mDGm-0 simple merge - one way
663 668 | |/
664 669 | o 25 g-1: update d
665 670 | |
666 671 o | 8 d-2 re-add d
667 672 | |
668 673 o | 7 d-1 delete d
669 674 |/
670 675 o 2 i-2: c -move-> d
671 676 |
672 677 o 1 i-1: a -move-> c
673 678 |
674 679 o 0 i-0 initial commit: a b h
675 680
676 681 One side of the merge have a long history with rename. The other side of the
677 682 merge point to a new file with a smaller history. Each side is "valid".
678 683
679 684 (and again the filelog based algorithm only explore one, with a pick based on
680 685 revision numbers)
681 686
682 687 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
683 688 A d
684 689 a (filelog !)
685 690 R a
686 691 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
687 692 A d
688 693 a
689 694 R a
690 695 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
691 696 M d
692 697 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
693 698 M d
694 699 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
695 700 M d
696 701 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
697 702 M d
698 703
699 704 $ hg log -Gfr 'desc("mDGm-0")' d
700 705 o 26 mDGm-0 simple merge - one way
701 706 |\
702 707 | o 25 g-1: update d
703 708 | |
704 709 o | 8 d-2 re-add d
705 710 |/
706 711 o 2 i-2: c -move-> d
707 712 |
708 713 o 1 i-1: a -move-> c
709 714 |
710 715 o 0 i-0 initial commit: a b h
711 716
712 717
713 718
714 719 $ hg log -Gfr 'desc("mDGm-0")' d
715 720 o 26 mDGm-0 simple merge - one way
716 721 |\
717 722 | o 25 g-1: update d
718 723 | |
719 724 o | 8 d-2 re-add d
720 725 |/
721 726 o 2 i-2: c -move-> d
722 727 |
723 728 o 1 i-1: a -move-> c
724 729 |
725 730 o 0 i-0 initial commit: a b h
726 731
727 732
728 733
729 734 Merge:
730 735 - one with change to a file (d)
731 736 - one overwriting that file with a rename (from h to i, to d)
732 737
733 738 This case is similar to BF/FB, but an actual merge happens, so both side of the
734 739 history are relevant.
735 740
736 741 Note:
737 742 | In this case, the merge get conflicting information since on one side we have
738 743 | "a -> c -> d". and one the other one we have "h -> i -> d".
739 744 |
740 745 | The current code arbitrarily pick one side
741 746
742 747 $ hg up 'desc("f-2")'
743 748 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
744 749 $ hg merge 'desc("g-1")' --tool :union
745 750 merging d
746 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
751 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
747 752 (branch merge, don't forget to commit)
748 753 $ hg ci -m 'mFGm-0 simple merge - one way'
749 754 created new head
750 755 $ hg up 'desc("g-1")'
751 756 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
752 757 $ hg merge 'desc("f-2")' --tool :union
753 758 merging d
754 0 files updated, 1 files merged, 1 files removed, 0 files unresolved
759 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
755 760 (branch merge, don't forget to commit)
756 761 $ hg ci -m 'mGFm-0 simple merge - the other way'
757 762 created new head
758 763 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
759 764 @ 29 mGFm-0 simple merge - the other way
760 765 |\
761 766 +---o 28 mFGm-0 simple merge - one way
762 767 | |/
763 768 | o 25 g-1: update d
764 769 | |
765 770 o | 22 f-2: rename i -> d
766 771 | |
767 772 o | 21 f-1: rename h -> i
768 773 |/
769 774 o 2 i-2: c -move-> d
770 775 |
771 776 o 1 i-1: a -move-> c
772 777 |
773 778 o 0 i-0 initial commit: a b h
774 779
775 780 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
776 781 A d
777 h (no-filelog !)
778 a (filelog !)
782 h
779 783 R a
780 784 R h
781 785 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
782 786 A d
783 a
787 a (no-filelog !)
788 h (filelog !)
784 789 R a
785 790 R h
786 791 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
787 792 M d
788 793 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
789 794 M d
790 795 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
791 796 M d
792 797 i (no-filelog !)
793 798 R i
794 799 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
795 800 M d
796 801 i (no-filelog !)
797 802 R i
798 803 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
799 804 M d
800 805 h (no-filelog !)
801 806 R h
802 807 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
803 808 M d
804 809 h (no-filelog !)
805 810 R h
806 811
807 812 $ hg log -Gfr 'desc("mFGm-0")' d
808 813 o 28 mFGm-0 simple merge - one way
809 814 |\
810 815 | o 25 g-1: update d
811 816 | |
812 817 o | 22 f-2: rename i -> d
813 818 | |
814 819 o | 21 f-1: rename h -> i
815 820 |/
816 821 o 2 i-2: c -move-> d
817 822 |
818 823 o 1 i-1: a -move-> c
819 824 |
820 825 o 0 i-0 initial commit: a b h
821 826
822 827
823 828 $ hg log -Gfr 'desc("mGFm-0")' d
824 829 @ 29 mGFm-0 simple merge - the other way
825 830 |\
826 831 | o 25 g-1: update d
827 832 | |
828 833 o | 22 f-2: rename i -> d
829 834 | |
830 835 o | 21 f-1: rename h -> i
831 836 |/
832 837 o 2 i-2: c -move-> d
833 838 |
834 839 o 1 i-1: a -move-> c
835 840 |
836 841 o 0 i-0 initial commit: a b h
837 842
838 843
839 844
840 845 Comparing with merging with a deletion (and keeping the file)
841 846 -------------------------------------------------------------
842 847
843 848 Merge:
844 849 - one removing a file (d)
845 850 - one updating that file
846 851 - the merge keep the modified version of the file (canceling the delete)
847 852
848 853 In this case, the file keep on living after the merge. So we should not drop its
849 854 copy tracing chain.
850 855
851 856 $ hg up 'desc("c-1")'
852 857 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
853 858 $ hg merge 'desc("g-1")'
854 859 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
855 860 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
856 861 What do you want to do? u
857 862 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
858 863 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
859 864 [1]
860 865 $ hg resolve -t :other d
861 866 (no more unresolved files)
862 867 $ hg ci -m "mCGm-0"
863 868 created new head
864 869
865 870 $ hg up 'desc("g-1")'
866 871 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
867 872 $ hg merge 'desc("c-1")'
868 873 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
869 874 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
870 875 What do you want to do? u
871 876 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
872 877 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
873 878 [1]
874 879 $ hg resolve -t :local d
875 880 (no more unresolved files)
876 881 $ hg ci -m "mGCm-0"
877 882 created new head
878 883
879 884 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
880 885 @ 31 mGCm-0
881 886 |\
882 887 +---o 30 mCGm-0
883 888 | |/
884 889 | o 25 g-1: update d
885 890 | |
886 891 o | 6 c-1 delete d
887 892 |/
888 893 o 2 i-2: c -move-> d
889 894 |
890 895 o 1 i-1: a -move-> c
891 896 |
892 897 o 0 i-0 initial commit: a b h
893 898
894 899
895 900 BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too
896 901
897 902 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
898 903 A d
899 904 a (filelog !)
900 905 R a
901 906 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
902 907 A d
903 908 a (filelog !)
904 909 R a
905 910 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
906 911 A d
907 912 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
908 913 A d
909 914 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
910 915 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
911 916
912 917
913 918 Comparing with merge restoring an untouched deleted file
914 919 --------------------------------------------------------
915 920
916 921 Merge:
917 922 - one removing a file (d)
918 923 - one leaving the file untouched
919 924 - the merge actively restore the file to the same content.
920 925
921 926 In this case, the file keep on living after the merge. So we should not drop its
922 927 copy tracing chain.
923 928
924 929 $ hg up 'desc("c-1")'
925 930 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
926 931 $ hg merge 'desc("b-1")'
927 932 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
928 933 (branch merge, don't forget to commit)
929 934 $ hg revert --rev 'desc("b-1")' d
930 935 $ hg ci -m "mCB-revert-m-0"
931 936 created new head
932 937
933 938 $ hg up 'desc("b-1")'
934 939 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
935 940 $ hg merge 'desc("c-1")'
936 941 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
937 942 (branch merge, don't forget to commit)
938 943 $ hg revert --rev 'desc("b-1")' d
939 944 $ hg ci -m "mBC-revert-m-0"
940 945 created new head
941 946
942 947 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
943 948 @ 33 mBC-revert-m-0
944 949 |\
945 950 +---o 32 mCB-revert-m-0
946 951 | |/
947 952 | o 6 c-1 delete d
948 953 | |
949 954 o | 5 b-1: b update
950 955 |/
951 956 o 2 i-2: c -move-> d
952 957 |
953 958 o 1 i-1: a -move-> c
954 959 |
955 960 o 0 i-0 initial commit: a b h
956 961
957 962
958 963 BROKEN: 'a' should be the the source of 'd' in the changeset centric algorithm too
959 964
960 965 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
961 966 M b
962 967 A d
963 968 a (filelog !)
964 969 R a
965 970 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
966 971 M b
967 972 A d
968 973 a (filelog !)
969 974 R a
970 975 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
971 976 M b
972 977 A d
973 978 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
974 979 M b
975 980 A d
976 981 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
977 982 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
978 983
General Comments 0
You need to be logged in to leave comments. Login now