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