##// END OF EJS Templates
tests: run python script through quoted interpreter instead of directly...
Matt Harbison -
r47859:7383df4f stable
parent child Browse files
Show More
@@ -1,3821 +1,3820 b''
1 1 #testcases filelog compatibility changeset sidedata upgraded upgraded-parallel
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 >> ./no-linkrev
18 18 > #!$PYTHON
19 19 > # filter out linkrev part of the debugindex command
20 20 > import sys
21 21 > for line in sys.stdin:
22 22 > if " linkrev " in line:
23 23 > print(line.rstrip())
24 24 > else:
25 25 > l = "%s *%s" % (line[:6], line[14:].rstrip())
26 26 > print(l)
27 27 > EOF
28 $ chmod +x no-linkrev
29 28
30 29 $ cat << EOF >> $HGRCPATH
31 30 > [diff]
32 31 > git=yes
33 32 > [command-templates]
34 33 > log={desc}\n
35 34 > EOF
36 35
37 36 #if compatibility
38 37 $ cat >> $HGRCPATH << EOF
39 38 > [experimental]
40 39 > copies.read-from = compatibility
41 40 > EOF
42 41 #endif
43 42
44 43 #if changeset
45 44 $ cat >> $HGRCPATH << EOF
46 45 > [experimental]
47 46 > copies.read-from = changeset-only
48 47 > copies.write-to = changeset-only
49 48 > EOF
50 49 #endif
51 50
52 51 #if sidedata
53 52 $ cat >> $HGRCPATH << EOF
54 53 > [format]
55 54 > exp-use-side-data = yes
56 55 > exp-use-copies-side-data-changeset = yes
57 56 > EOF
58 57 #endif
59 58
60 59
61 60 $ cat > same-content.txt << EOF
62 61 > Here is some content that will be the same accros multiple file.
63 62 >
64 63 > This is done on purpose so that we end up in some merge situation, were the
65 64 > resulting content is the same as in the parent(s), but a new filenodes still
66 65 > need to be created to record some file history information (especially
67 66 > about copies).
68 67 > EOF
69 68
70 69 $ hg init repo-chain
71 70 $ cd repo-chain
72 71
73 72 Add some linear rename initialy
74 73
75 74 $ cp ../same-content.txt a
76 75 $ cp ../same-content.txt b
77 76 $ cp ../same-content.txt h
78 77 $ echo "original content for P" > p
79 78 $ echo "original content for Q" > q
80 79 $ echo "original content for R" > r
81 80 $ hg ci -Am 'i-0 initial commit: a b h p q r'
82 81 adding a
83 82 adding b
84 83 adding h
85 84 adding p
86 85 adding q
87 86 adding r
88 87 $ hg mv a c
89 88 $ hg mv p s
90 89 $ hg ci -Am 'i-1: a -move-> c, p -move-> s'
91 90 $ hg mv c d
92 91 $ hg mv s t
93 92 $ hg ci -Am 'i-2: c -move-> d, s -move-> t'
94 93 $ hg log -G
95 94 @ i-2: c -move-> d, s -move-> t
96 95 |
97 96 o i-1: a -move-> c, p -move-> s
98 97 |
99 98 o i-0 initial commit: a b h p q r
100 99
101 100
102 101 And having another branch with renames on the other side
103 102
104 103 $ hg mv d e
105 104 $ hg ci -Am 'a-1: d -move-> e'
106 105 $ hg mv e f
107 106 $ hg ci -Am 'a-2: e -move-> f'
108 107 $ hg log -G --rev '::.'
109 108 @ a-2: e -move-> f
110 109 |
111 110 o a-1: d -move-> e
112 111 |
113 112 o i-2: c -move-> d, s -move-> t
114 113 |
115 114 o i-1: a -move-> c, p -move-> s
116 115 |
117 116 o i-0 initial commit: a b h p q r
118 117
119 118
120 119 Have a branching with nothing on one side
121 120
122 121 $ hg up 'desc("i-2")'
123 122 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
124 123 $ echo foo > b
125 124 $ hg ci -m 'b-1: b update'
126 125 created new head
127 126 $ hg log -G --rev '::.'
128 127 @ b-1: b update
129 128 |
130 129 o i-2: c -move-> d, s -move-> t
131 130 |
132 131 o i-1: a -move-> c, p -move-> s
133 132 |
134 133 o i-0 initial commit: a b h p q r
135 134
136 135
137 136 Create a branch that delete a file previous renamed
138 137
139 138 $ hg up 'desc("i-2")'
140 139 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
141 140 $ hg rm d
142 141 $ hg ci -m 'c-1 delete d'
143 142 created new head
144 143 $ hg log -G --rev '::.'
145 144 @ c-1 delete d
146 145 |
147 146 o i-2: c -move-> d, s -move-> t
148 147 |
149 148 o i-1: a -move-> c, p -move-> s
150 149 |
151 150 o i-0 initial commit: a b h p q r
152 151
153 152
154 153 Create a branch that delete a file previous renamed and recreate it
155 154
156 155 $ hg up 'desc("i-2")'
157 156 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
158 157 $ hg rm d
159 158 $ hg ci -m 'd-1 delete d'
160 159 created new head
161 160 $ echo bar > d
162 161 $ hg add d
163 162 $ hg ci -m 'd-2 re-add d'
164 163 $ hg log -G --rev '::.'
165 164 @ d-2 re-add d
166 165 |
167 166 o d-1 delete d
168 167 |
169 168 o i-2: c -move-> d, s -move-> t
170 169 |
171 170 o i-1: a -move-> c, p -move-> s
172 171 |
173 172 o i-0 initial commit: a b h p q r
174 173
175 174
176 175 Having another branch renaming a different file to the same filename as another
177 176
178 177 $ hg up 'desc("i-2")'
179 178 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
180 179 $ hg mv b g
181 180 $ hg ci -m 'e-1 b -move-> g'
182 181 created new head
183 182 $ hg mv g f
184 183 $ hg ci -m 'e-2 g -move-> f'
185 184 $ hg log -G --rev '::.'
186 185 @ e-2 g -move-> f
187 186 |
188 187 o e-1 b -move-> g
189 188 |
190 189 o i-2: c -move-> d, s -move-> t
191 190 |
192 191 o i-1: a -move-> c, p -move-> s
193 192 |
194 193 o i-0 initial commit: a b h p q r
195 194
196 195 $ hg up -q null
197 196
198 197 Having a branch similar to the 'a' one, but moving the 'p' file around.
199 198
200 199 $ hg up 'desc("i-2")'
201 200 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
202 201 $ hg mv t u
203 202 $ hg ci -Am 'p-1: t -move-> u'
204 203 created new head
205 204 $ hg mv u v
206 205 $ hg ci -Am 'p-2: u -move-> v'
207 206 $ hg log -G --rev '::.'
208 207 @ p-2: u -move-> v
209 208 |
210 209 o p-1: t -move-> u
211 210 |
212 211 o i-2: c -move-> d, s -move-> t
213 212 |
214 213 o i-1: a -move-> c, p -move-> s
215 214 |
216 215 o i-0 initial commit: a b h p q r
217 216
218 217 $ hg up -q null
219 218
220 219 Having another branch renaming a different file to the same filename as another
221 220
222 221 $ hg up 'desc("i-2")'
223 222 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
224 223 $ hg mv r w
225 224 $ hg ci -m 'q-1 r -move-> w'
226 225 created new head
227 226 $ hg mv w v
228 227 $ hg ci -m 'q-2 w -move-> v'
229 228 $ hg log -G --rev '::.'
230 229 @ q-2 w -move-> v
231 230 |
232 231 o q-1 r -move-> w
233 232 |
234 233 o i-2: c -move-> d, s -move-> t
235 234 |
236 235 o i-1: a -move-> c, p -move-> s
237 236 |
238 237 o i-0 initial commit: a b h p q r
239 238
240 239 $ hg up -q null
241 240
242 241 Setup all merge
243 242 ===============
244 243
245 244 This is done beforehand to validate that the upgrade process creates valid copy
246 245 information.
247 246
248 247 merging with unrelated change does not interfere with the renames
249 248 ---------------------------------------------------------------
250 249
251 250 - rename on one side
252 251 - unrelated change on the other side
253 252
254 253 $ case_desc="simple merge - A side: multiple renames, B side: unrelated update"
255 254
256 255 $ hg up 'desc("b-1")'
257 256 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
258 257 $ hg merge 'desc("a-2")'
259 258 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
260 259 (branch merge, don't forget to commit)
261 260 $ hg ci -m "mBAm-0 $case_desc - one way"
262 261 $ hg up 'desc("a-2")'
263 262 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
264 263 $ hg merge 'desc("b-1")'
265 264 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
266 265 (branch merge, don't forget to commit)
267 266 $ hg ci -m "mABm-0 $case_desc - the other way"
268 267 created new head
269 268 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
270 269 @ mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
271 270 |\
272 271 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
273 272 | |/
274 273 | o b-1: b update
275 274 | |
276 275 o | a-2: e -move-> f
277 276 | |
278 277 o | a-1: d -move-> e
279 278 |/
280 279 o i-2: c -move-> d, s -move-> t
281 280 |
282 281 o i-1: a -move-> c, p -move-> s
283 282 |
284 283 o i-0 initial commit: a b h p q r
285 284
286 285
287 286
288 287 merging with the side having a delete
289 288 -------------------------------------
290 289
291 290 case summary:
292 291 - one with change to an unrelated file
293 292 - one deleting the change
294 293 and recreate an unrelated file after the merge
295 294
296 295 $ case_desc="simple merge - C side: delete a file with copies history , B side: unrelated update"
297 296
298 297 $ hg up 'desc("b-1")'
299 298 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
300 299 $ hg merge 'desc("c-1")'
301 300 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
302 301 (branch merge, don't forget to commit)
303 302 $ hg ci -m "mBCm-0 $case_desc - one way"
304 303 $ echo bar > d
305 304 $ hg add d
306 305 $ hg ci -m 'mBCm-1 re-add d'
307 306 $ hg up 'desc("c-1")'
308 307 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
309 308 $ hg merge 'desc("b-1")'
310 309 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
311 310 (branch merge, don't forget to commit)
312 311 $ hg ci -m "mCBm-0 $case_desc - the other way"
313 312 created new head
314 313 $ echo bar > d
315 314 $ hg add d
316 315 $ hg ci -m 'mCBm-1 re-add d'
317 316 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
318 317 @ mCBm-1 re-add d
319 318 |
320 319 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
321 320 |\
322 321 | | o mBCm-1 re-add d
323 322 | | |
324 323 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
325 324 | |/
326 325 | o c-1 delete d
327 326 | |
328 327 o | b-1: b update
329 328 |/
330 329 o i-2: c -move-> d, s -move-> t
331 330 |
332 331 o i-1: a -move-> c, p -move-> s
333 332 |
334 333 o i-0 initial commit: a b h p q r
335 334
336 335
337 336 Comparing with a merge re-adding the file afterward
338 337 ---------------------------------------------------
339 338
340 339 Merge:
341 340 - one with change to an unrelated file
342 341 - one deleting and recreating the change
343 342
344 343 $ case_desc="simple merge - B side: unrelated update, D side: delete and recreate a file (with different content)"
345 344
346 345 $ hg up 'desc("b-1")'
347 346 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
348 347 $ hg merge 'desc("d-2")'
349 348 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
350 349 (branch merge, don't forget to commit)
351 350 $ hg ci -m "mBDm-0 $case_desc - one way"
352 351 $ hg up 'desc("d-2")'
353 352 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
354 353 $ hg merge 'desc("b-1")'
355 354 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
356 355 (branch merge, don't forget to commit)
357 356 $ hg ci -m "mDBm-0 $case_desc - the other way"
358 357 created new head
359 358 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
360 359 @ mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
361 360 |\
362 361 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
363 362 | |/
364 363 | o d-2 re-add d
365 364 | |
366 365 | o d-1 delete d
367 366 | |
368 367 o | b-1: b update
369 368 |/
370 369 o i-2: c -move-> d, s -move-> t
371 370 |
372 371 o i-1: a -move-> c, p -move-> s
373 372 |
374 373 o i-0 initial commit: a b h p q r
375 374
376 375
377 376
378 377 Comparing with a merge with colliding rename
379 378 --------------------------------------------
380 379
381 380 Subcase: new copy information on both side
382 381 ``````````````````````````````````````````
383 382
384 383 - the "e-" branch renaming b to f (through 'g')
385 384 - the "a-" branch renaming d to f (through e)
386 385
387 386 $ case_desc="merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f)"
388 387
389 388 $ hg up 'desc("a-2")'
390 389 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
391 390 $ hg merge 'desc("e-2")'
392 391 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
393 392 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
394 393 (branch merge, don't forget to commit)
395 394 $ hg ci -m "mAEm-0 $case_desc - one way"
396 395 $ hg up 'desc("e-2")'
397 396 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
398 397 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
399 398 $ hg merge 'desc("a-2")'
400 399 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
401 400 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
402 401 (branch merge, don't forget to commit)
403 402 $ hg ci -m "mEAm-0 $case_desc - the other way"
404 403 created new head
405 404 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
406 405 @ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
407 406 |\
408 407 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
409 408 | |/
410 409 | o e-2 g -move-> f
411 410 | |
412 411 | o e-1 b -move-> g
413 412 | |
414 413 o | a-2: e -move-> f
415 414 | |
416 415 o | a-1: d -move-> e
417 416 |/
418 417 o i-2: c -move-> d, s -move-> t
419 418 |
420 419 o i-1: a -move-> c, p -move-> s
421 420 |
422 421 o i-0 initial commit: a b h p q r
423 422
424 423
425 424 Subcase: new copy information on both side with an actual merge happening
426 425 `````````````````````````````````````````````````````````````````````````
427 426
428 427 - the "p-" branch renaming 't' to 'v' (through 'u')
429 428 - the "q-" branch renaming 'r' to 'v' (through 'w')
430 429
431 430 $ case_desc="merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content)"
432 431
433 432 $ hg up 'desc("p-2")'
434 433 3 files updated, 0 files merged, 2 files removed, 0 files unresolved
435 434 $ hg merge 'desc("q-2")' --tool ':union'
436 435 merging v
437 436 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
438 437 (branch merge, don't forget to commit)
439 438 $ hg ci -m "mPQm-0 $case_desc - one way"
440 439 $ hg up 'desc("q-2")'
441 440 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
442 441 $ hg merge 'desc("p-2")' --tool ':union'
443 442 merging v
444 443 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
445 444 (branch merge, don't forget to commit)
446 445 $ hg ci -m "mQPm-0 $case_desc - the other way"
447 446 created new head
448 447 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
449 448 o mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
450 449 |\
451 450 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
452 451 | |/
453 452 | o e-2 g -move-> f
454 453 | |
455 454 | o e-1 b -move-> g
456 455 | |
457 456 o | a-2: e -move-> f
458 457 | |
459 458 o | a-1: d -move-> e
460 459 |/
461 460 o i-2: c -move-> d, s -move-> t
462 461 |
463 462 o i-1: a -move-> c, p -move-> s
464 463 |
465 464 o i-0 initial commit: a b h p q r
466 465
467 466
468 467 Subcase: existing copy information overwritten on one branch
469 468 ````````````````````````````````````````````````````````````
470 469
471 470 Merge:
472 471 - one with change to an unrelated file (b)
473 472 - one overwriting a file (d) with a rename (from h to i to d)
474 473
475 474 $ case_desc="simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
476 475
477 476 $ hg up 'desc("i-2")'
478 477 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
479 478 $ hg mv h i
480 479 $ hg commit -m "f-1: rename h -> i"
481 480 created new head
482 481 $ hg mv --force i d
483 482 $ hg commit -m "f-2: rename i -> d"
484 $ hg debugindex d | ../no-linkrev
483 $ hg debugindex d | "$PYTHON" ../no-linkrev
485 484 rev linkrev nodeid p1 p2
486 485 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
487 486 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
488 487 1 * b004912a8510 000000000000 000000000000
489 488 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
490 489 $ hg up 'desc("b-1")'
491 490 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
492 491 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
493 492 $ hg merge 'desc("f-2")'
494 493 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
495 494 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
496 495 (branch merge, don't forget to commit)
497 496 $ hg ci -m "mBFm-0 $case_desc - one way"
498 497 $ hg up 'desc("f-2")'
499 498 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
500 499 $ hg merge 'desc("b-1")'
501 500 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
502 501 (branch merge, don't forget to commit)
503 502 $ hg ci -m "mFBm-0 $case_desc - the other way"
504 503 created new head
505 504 $ hg up null --quiet
506 505 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
507 506 o mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
508 507 |\
509 508 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
510 509 | |/
511 510 | o f-2: rename i -> d
512 511 | |
513 512 | o f-1: rename h -> i
514 513 | |
515 514 o | b-1: b update
516 515 |/
517 516 o i-2: c -move-> d, s -move-> t
518 517 |
519 518 o i-1: a -move-> c, p -move-> s
520 519 |
521 520 o i-0 initial commit: a b h p q r
522 521
523 522
524 523 Subcase: existing copy information overwritten on one branch, with different content)
525 524 `````````````````````````````````````````````````````````````````````````````````````
526 525
527 526 Merge:
528 527 - one with change to an unrelated file (b)
529 528 - one overwriting a file (t) with a rename (from r to x to t), v content is not the same as on the other branch
530 529
531 530 $ case_desc="simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content"
532 531
533 532 $ hg up 'desc("i-2")'
534 533 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
535 534 $ hg mv r x
536 535 $ hg commit -m "r-1: rename r -> x"
537 536 created new head
538 537 $ hg mv --force x t
539 538 $ hg commit -m "r-2: rename t -> x"
540 $ hg debugindex t | ../no-linkrev
539 $ hg debugindex t | "$PYTHON" ../no-linkrev
541 540 rev linkrev nodeid p1 p2
542 541 0 * d74efbf65309 000000000000 000000000000 (no-changeset !)
543 542 1 * 02a930b9d7ad 000000000000 000000000000 (no-changeset !)
544 543 0 * 5aed6a8dbff0 000000000000 000000000000 (changeset !)
545 544 1 * a38b2fa17021 000000000000 000000000000 (changeset !)
546 545 $ hg up 'desc("b-1")'
547 546 3 files updated, 0 files merged, 0 files removed, 0 files unresolved
548 547 $ hg merge 'desc("r-2")'
549 548 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
550 549 (branch merge, don't forget to commit)
551 550 $ hg ci -m "mBRm-0 $case_desc - one way"
552 551 $ hg up 'desc("r-2")'
553 552 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
554 553 $ hg merge 'desc("b-1")'
555 554 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
556 555 (branch merge, don't forget to commit)
557 556 $ hg ci -m "mRBm-0 $case_desc - the other way"
558 557 created new head
559 558 $ hg up null --quiet
560 559 $ hg log -G --rev '::(desc("mBRm")+desc("mRBm"))'
561 560 o mRBm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - the other way
562 561 |\
563 562 +---o mBRm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - one way
564 563 | |/
565 564 | o r-2: rename t -> x
566 565 | |
567 566 | o r-1: rename r -> x
568 567 | |
569 568 o | b-1: b update
570 569 |/
571 570 o i-2: c -move-> d, s -move-> t
572 571 |
573 572 o i-1: a -move-> c, p -move-> s
574 573 |
575 574 o i-0 initial commit: a b h p q r
576 575
577 576
578 577
579 578 Subcase: reset of the copy history on one side
580 579 ``````````````````````````````````````````````
581 580
582 581 Merge:
583 582 - one with change to a file
584 583 - one deleting and recreating the file
585 584
586 585 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
587 586 consider history and rename on both branch of the merge.
588 587
589 588 $ case_desc="actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content"
590 589
591 590 $ hg up 'desc("i-2")'
592 591 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
593 592 $ echo "some update" >> d
594 593 $ hg commit -m "g-1: update d"
595 594 created new head
596 595 $ hg up 'desc("d-2")'
597 596 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
598 597 $ hg merge 'desc("g-1")' --tool :union
599 598 merging d
600 599 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
601 600 (branch merge, don't forget to commit)
602 601 $ hg ci -m "mDGm-0 $case_desc - one way"
603 602 $ hg up 'desc("g-1")'
604 603 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 604 $ hg merge 'desc("d-2")' --tool :union
606 605 merging d
607 606 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
608 607 (branch merge, don't forget to commit)
609 608 $ hg ci -m "mGDm-0 $case_desc - the other way"
610 609 created new head
611 610 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
612 611 @ mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
613 612 |\
614 613 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
615 614 | |/
616 615 | o g-1: update d
617 616 | |
618 617 o | d-2 re-add d
619 618 | |
620 619 o | d-1 delete d
621 620 |/
622 621 o i-2: c -move-> d, s -move-> t
623 622 |
624 623 o i-1: a -move-> c, p -move-> s
625 624 |
626 625 o i-0 initial commit: a b h p q r
627 626
628 627
629 628 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
630 629 ````````````````````````````````````````````````````````````````````````````````````````````
631 630
632 631 Merge:
633 632 - one with change to a file (d)
634 633 - one overwriting that file with a rename (from h to i, to d)
635 634
636 635 This case is similar to BF/FB, but an actual merge happens, so both side of the
637 636 history are relevant.
638 637
639 638 Note:
640 639 | In this case, the merge get conflicting information since on one side we have
641 640 | "a -> c -> d". and one the other one we have "h -> i -> d".
642 641 |
643 642 | The current code arbitrarily pick one side
644 643
645 644 $ case_desc="merge - G side: content change, F side: copy overwrite, no content change"
646 645
647 646 $ hg up 'desc("f-2")'
648 647 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
649 648 $ hg merge 'desc("g-1")' --tool :union
650 649 merging d (no-changeset !)
651 650 0 files updated, 1 files merged, 0 files removed, 0 files unresolved (no-changeset !)
652 651 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
653 652 (branch merge, don't forget to commit)
654 653 $ hg ci -m "mFGm-0 $case_desc - one way"
655 654 created new head
656 655 $ hg up 'desc("g-1")'
657 656 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
658 657 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
659 658 $ hg merge 'desc("f-2")' --tool :union
660 659 merging d (no-changeset !)
661 660 0 files updated, 1 files merged, 1 files removed, 0 files unresolved (no-changeset !)
662 661 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
663 662 (branch merge, don't forget to commit)
664 663 $ hg ci -m "mGFm-0 $case_desc - the other way"
665 664 created new head
666 665 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
667 666 @ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
668 667 |\
669 668 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
670 669 | |/
671 670 | o g-1: update d
672 671 | |
673 672 o | f-2: rename i -> d
674 673 | |
675 674 o | f-1: rename h -> i
676 675 |/
677 676 o i-2: c -move-> d, s -move-> t
678 677 |
679 678 o i-1: a -move-> c, p -move-> s
680 679 |
681 680 o i-0 initial commit: a b h p q r
682 681
683 682
684 683
685 684 Comparing with merging with a deletion (and keeping the file)
686 685 -------------------------------------------------------------
687 686
688 687 Merge:
689 688 - one removing a file (d)
690 689 - one updating that file
691 690 - the merge keep the modified version of the file (canceling the delete)
692 691
693 692 In this case, the file keep on living after the merge. So we should not drop its
694 693 copy tracing chain.
695 694
696 695 $ case_desc="merge updated/deleted - revive the file (updated content)"
697 696
698 697 $ hg up 'desc("c-1")'
699 698 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
700 699 $ hg merge 'desc("g-1")'
701 700 file 'd' was deleted in local [working copy] but was modified in other [merge rev].
702 701 You can use (c)hanged version, leave (d)eleted, or leave (u)nresolved.
703 702 What do you want to do? u
704 703 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
705 704 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
706 705 [1]
707 706 $ hg resolve -t :other d
708 707 (no more unresolved files)
709 708 $ hg ci -m "mCGm-0 $case_desc - one way"
710 709 created new head
711 710
712 711 $ hg up 'desc("g-1")'
713 712 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
714 713 $ hg merge 'desc("c-1")'
715 714 file 'd' was deleted in other [merge rev] but was modified in local [working copy].
716 715 You can use (c)hanged version, (d)elete, or leave (u)nresolved.
717 716 What do you want to do? u
718 717 0 files updated, 0 files merged, 0 files removed, 1 files unresolved
719 718 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon
720 719 [1]
721 720 $ hg resolve -t :local d
722 721 (no more unresolved files)
723 722 $ hg ci -m "mGCm-0 $case_desc - the other way"
724 723 created new head
725 724
726 725 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
727 726 @ mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
728 727 |\
729 728 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
730 729 | |/
731 730 | o g-1: update d
732 731 | |
733 732 o | c-1 delete d
734 733 |/
735 734 o i-2: c -move-> d, s -move-> t
736 735 |
737 736 o i-1: a -move-> c, p -move-> s
738 737 |
739 738 o i-0 initial commit: a b h p q r
740 739
741 740
742 741
743 742
744 743 Comparing with merge restoring an untouched deleted file
745 744 --------------------------------------------------------
746 745
747 746 Merge:
748 747 - one removing a file (d)
749 748 - one leaving the file untouched
750 749 - the merge actively restore the file to the same content.
751 750
752 751 In this case, the file keep on living after the merge. So we should not drop its
753 752 copy tracing chain.
754 753
755 754 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
756 755
757 756 $ hg up 'desc("c-1")'
758 757 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
759 758 $ hg merge 'desc("b-1")'
760 759 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
761 760 (branch merge, don't forget to commit)
762 761 $ hg revert --rev 'desc("b-1")' d
763 762 $ hg ci -m "mCB-revert-m-0 $case_desc - one way"
764 763 created new head
765 764
766 765 $ hg up 'desc("b-1")'
767 766 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
768 767 $ hg merge 'desc("c-1")'
769 768 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
770 769 (branch merge, don't forget to commit)
771 770 $ hg revert --rev 'desc("b-1")' d
772 771 $ hg ci -m "mBC-revert-m-0 $case_desc - the other way"
773 772 created new head
774 773
775 774 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
776 775 @ mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
777 776 |\
778 777 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
779 778 | |/
780 779 | o c-1 delete d
781 780 | |
782 781 o | b-1: b update
783 782 |/
784 783 o i-2: c -move-> d, s -move-> t
785 784 |
786 785 o i-1: a -move-> c, p -move-> s
787 786 |
788 787 o i-0 initial commit: a b h p q r
789 788
790 789
791 790
792 791 $ hg up null --quiet
793 792
794 793 Merging a branch where a rename was deleted with a branch where the same file was renamed
795 794 ------------------------------------------------------------------------------------------
796 795
797 796 Create a "conflicting" merge where `d` get removed on one branch before its
798 797 rename information actually conflict with the other branch.
799 798
800 799 (the copy information from the branch that was not deleted should win).
801 800
802 801 $ case_desc="simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch)"
803 802
804 803 $ hg up 'desc("i-0")'
805 804 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
806 805 $ hg mv b d
807 806 $ hg ci -m "h-1: b -(move)-> d"
808 807 created new head
809 808
810 809 $ hg up 'desc("c-1")'
811 810 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
812 811 $ hg merge 'desc("h-1")'
813 812 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
814 813 (branch merge, don't forget to commit)
815 814 $ hg ci -m "mCH-delete-before-conflict-m-0 $case_desc - one way"
816 815
817 816 $ hg up 'desc("h-1")'
818 817 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
819 818 $ hg merge 'desc("c-1")'
820 819 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
821 820 (branch merge, don't forget to commit)
822 821 $ hg ci -m "mHC-delete-before-conflict-m-0 $case_desc - the other way"
823 822 created new head
824 823 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
825 824 @ mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
826 825 |\
827 826 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
828 827 | |/
829 828 | o h-1: b -(move)-> d
830 829 | |
831 830 o | c-1 delete d
832 831 | |
833 832 o | i-2: c -move-> d, s -move-> t
834 833 | |
835 834 o | i-1: a -move-> c, p -move-> s
836 835 |/
837 836 o i-0 initial commit: a b h p q r
838 837
839 838
840 839 Variant of previous with extra changes introduced by the merge
841 840 --------------------------------------------------------------
842 841
843 842 Multiple cases above explicitely test cases where content are the same on both side during merge. In this section we will introduce variants for theses cases where new change are introduced to these file content during the merges.
844 843
845 844
846 845 Subcase: merge has same initial content on both side, but merge introduced a change
847 846 ```````````````````````````````````````````````````````````````````````````````````
848 847
849 848 Same as `mAEm` and `mEAm` but with extra change to the file before commiting
850 849
851 850 - the "e-" branch renaming b to f (through 'g')
852 851 - the "a-" branch renaming d to f (through e)
853 852
854 853 $ case_desc="merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent)"
855 854
856 855 $ hg up 'desc("a-2")'
857 856 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
858 857 $ hg merge 'desc("e-2")'
859 858 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
860 859 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
861 860 (branch merge, don't forget to commit)
862 861 $ echo "content change for mAE-change-m" > f
863 862 $ hg ci -m "mAE-change-m-0 $case_desc - one way"
864 863 created new head
865 864 $ hg up 'desc("e-2")'
866 865 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
867 866 $ hg merge 'desc("a-2")'
868 867 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
869 868 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
870 869 (branch merge, don't forget to commit)
871 870 $ echo "content change for mEA-change-m" > f
872 871 $ hg ci -m "mEA-change-m-0 $case_desc - the other way"
873 872 created new head
874 873 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
875 874 @ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
876 875 |\
877 876 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
878 877 | |/
879 878 | o e-2 g -move-> f
880 879 | |
881 880 | o e-1 b -move-> g
882 881 | |
883 882 o | a-2: e -move-> f
884 883 | |
885 884 o | a-1: d -move-> e
886 885 |/
887 886 o i-2: c -move-> d, s -move-> t
888 887 |
889 888 o i-1: a -move-> c, p -move-> s
890 889 |
891 890 o i-0 initial commit: a b h p q r
892 891
893 892
894 893 Subcase: merge overwrite common copy information, but with extra change during the merge
895 894 ````````````````````````````````````````````````````````````````````````````````````````
896 895
897 896 Merge:
898 897 - one with change to an unrelated file (b)
899 898 - one overwriting a file (d) with a rename (from h to i to d)
900 899 - the merge update f content
901 900
902 901 $ case_desc="merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d)"
903 902
904 903 $ hg up 'desc("f-2")'
905 904 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
906 905 #if no-changeset
907 $ hg debugindex d | ../no-linkrev
906 $ hg debugindex d | "$PYTHON" ../no-linkrev
908 907 rev linkrev nodeid p1 p2
909 908 0 * d8252ab2e760 000000000000 000000000000
910 909 1 * b004912a8510 000000000000 000000000000
911 910 2 * 7b79e2fe0c89 000000000000 000000000000
912 911 3 * 17ec97e60577 d8252ab2e760 000000000000
913 912 4 * 06dabf50734c b004912a8510 17ec97e60577
914 913 5 * 19c0e3924691 17ec97e60577 b004912a8510
915 914 6 * 89c873a01d97 7b79e2fe0c89 17ec97e60577
916 915 7 * d55cb4e9ef57 000000000000 000000000000
917 916 #else
918 $ hg debugindex d | ../no-linkrev
917 $ hg debugindex d | "$PYTHON" ../no-linkrev
919 918 rev linkrev nodeid p1 p2
920 919 0 * ae258f702dfe 000000000000 000000000000
921 920 1 * b004912a8510 000000000000 000000000000
922 921 2 * 5cce88bf349f ae258f702dfe 000000000000
923 922 3 * cc269dd788c8 b004912a8510 5cce88bf349f
924 923 4 * 51c91a115080 5cce88bf349f b004912a8510
925 924 #endif
926 925 $ hg up 'desc("b-1")'
927 926 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
928 927 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
929 928 $ hg merge 'desc("f-2")'
930 929 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
931 930 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
932 931 (branch merge, don't forget to commit)
933 932 $ echo "extra-change to (formelly h) during the merge" > d
934 933 $ hg ci -m "mBF-change-m-0 $case_desc - one way"
935 934 created new head
936 935 $ hg manifest --rev . --debug | grep " d"
937 936 1c334238bd42ec85c6a0d83fd1b2a898a6a3215d 644 d (no-changeset !)
938 937 cea2d99c0fde64672ef61953786fdff34f16e230 644 d (changeset !)
939 938
940 939 $ hg up 'desc("f-2")'
941 940 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
942 941 $ hg merge 'desc("b-1")'
943 942 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
944 943 (branch merge, don't forget to commit)
945 944 $ echo "extra-change to (formelly h) during the merge" > d
946 945 $ hg ci -m "mFB-change-m-0 $case_desc - the other way"
947 946 created new head
948 947 $ hg manifest --rev . --debug | grep " d"
949 948 1c334238bd42ec85c6a0d83fd1b2a898a6a3215d 644 d (no-changeset !)
950 949 cea2d99c0fde64672ef61953786fdff34f16e230 644 d (changeset !)
951 950 #if no-changeset
952 $ hg debugindex d | ../no-linkrev
951 $ hg debugindex d | "$PYTHON" ../no-linkrev
953 952 rev linkrev nodeid p1 p2
954 953 0 * d8252ab2e760 000000000000 000000000000
955 954 1 * b004912a8510 000000000000 000000000000
956 955 2 * 7b79e2fe0c89 000000000000 000000000000
957 956 3 * 17ec97e60577 d8252ab2e760 000000000000
958 957 4 * 06dabf50734c b004912a8510 17ec97e60577
959 958 5 * 19c0e3924691 17ec97e60577 b004912a8510
960 959 6 * 89c873a01d97 7b79e2fe0c89 17ec97e60577
961 960 7 * d55cb4e9ef57 000000000000 000000000000
962 961 8 * 1c334238bd42 7b79e2fe0c89 000000000000
963 962 #else
964 $ hg debugindex d | ../no-linkrev
963 $ hg debugindex d | "$PYTHON" ../no-linkrev
965 964 rev linkrev nodeid p1 p2
966 965 0 * ae258f702dfe 000000000000 000000000000
967 966 1 * b004912a8510 000000000000 000000000000
968 967 2 * 5cce88bf349f ae258f702dfe 000000000000
969 968 3 * cc269dd788c8 b004912a8510 5cce88bf349f
970 969 4 * 51c91a115080 5cce88bf349f b004912a8510
971 970 5 * cea2d99c0fde ae258f702dfe 000000000000
972 971 #endif
973 972 $ hg log -G --rev '::(desc("mBF-change-m")+desc("mFB-change-m"))'
974 973 @ mFB-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
975 974 |\
976 975 +---o mBF-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
977 976 | |/
978 977 | o f-2: rename i -> d
979 978 | |
980 979 | o f-1: rename h -> i
981 980 | |
982 981 o | b-1: b update
983 982 |/
984 983 o i-2: c -move-> d, s -move-> t
985 984 |
986 985 o i-1: a -move-> c, p -move-> s
987 986 |
988 987 o i-0 initial commit: a b h p q r
989 988
990 989
991 990 Subcase: restoring and untouched deleted file, while touching it
992 991 ````````````````````````````````````````````````````````````````
993 992
994 993 Merge:
995 994 - one removing a file (d)
996 995 - one leaving the file untouched
997 996 - the merge actively restore the file to the same content.
998 997
999 998 In this case, the file keep on living after the merge. So we should not drop its
1000 999 copy tracing chain.
1001 1000
1002 1001 $ case_desc="merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge)"
1003 1002
1004 1003 $ hg up 'desc("c-1")'
1005 1004 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1006 1005 $ hg merge 'desc("b-1")'
1007 1006 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1008 1007 (branch merge, don't forget to commit)
1009 1008 $ hg revert --rev 'desc("b-1")' d
1010 1009 $ echo "new content for d after the revert" > d
1011 1010 $ hg ci -m "mCB-change-m-0 $case_desc - one way"
1012 1011 created new head
1013 1012 $ hg manifest --rev . --debug | grep " d"
1014 1013 e333780c17752a3b0dd15e3ad48aa4e5c745f621 644 d (no-changeset !)
1015 1014 4b540a18ad699234b2b2aa18cb69555ac9c4b1df 644 d (changeset !)
1016 1015
1017 1016 $ hg up 'desc("b-1")'
1018 1017 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1019 1018 $ hg merge 'desc("c-1")'
1020 1019 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1021 1020 (branch merge, don't forget to commit)
1022 1021 $ hg revert --rev 'desc("b-1")' d
1023 1022 $ echo "new content for d after the revert" > d
1024 1023 $ hg ci -m "mBC-change-m-0 $case_desc - the other way"
1025 1024 created new head
1026 1025 $ hg manifest --rev . --debug | grep " d"
1027 1026 e333780c17752a3b0dd15e3ad48aa4e5c745f621 644 d (no-changeset !)
1028 1027 4b540a18ad699234b2b2aa18cb69555ac9c4b1df 644 d (changeset !)
1029 1028
1030 1029
1031 1030 $ hg up null --quiet
1032 1031 $ hg log -G --rev '::(desc("mCB-change-m")+desc("mBC-change-m"))'
1033 1032 o mBC-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1034 1033 |\
1035 1034 +---o mCB-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1036 1035 | |/
1037 1036 | o c-1 delete d
1038 1037 | |
1039 1038 o | b-1: b update
1040 1039 |/
1041 1040 o i-2: c -move-> d, s -move-> t
1042 1041 |
1043 1042 o i-1: a -move-> c, p -move-> s
1044 1043 |
1045 1044 o i-0 initial commit: a b h p q r
1046 1045
1047 1046
1048 1047 Decision from previous merge are properly chained with later merge
1049 1048 ------------------------------------------------------------------
1050 1049
1051 1050 Subcase: chaining conflicting rename resolution
1052 1051 ```````````````````````````````````````````````
1053 1052
1054 1053 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
1055 1054 add more change on the respective branch and merge again. These second merge
1056 1055 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
1057 1056 about that file should stay unchanged.
1058 1057
1059 1058 We also touch J during some of the merge to check for unrelated change to new file during merge.
1060 1059
1061 1060 $ case_desc="chained merges (conflict -> simple) - same content everywhere"
1062 1061
1063 1062 (extra unrelated changes)
1064 1063
1065 1064 $ hg up 'desc("a-2")'
1066 1065 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1067 1066 $ echo j > unrelated-j
1068 1067 $ hg add unrelated-j
1069 1068 $ hg ci -m 'j-1: unrelated changes (based on the "a" series of changes)'
1070 1069 created new head
1071 1070
1072 1071 $ hg up 'desc("e-2")'
1073 1072 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
1074 1073 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
1075 1074 $ echo k > unrelated-k
1076 1075 $ hg add unrelated-k
1077 1076 $ hg ci -m 'k-1: unrelated changes (based on "e" changes)'
1078 1077 created new head
1079 1078
1080 1079 (merge variant 1)
1081 1080
1082 1081 $ hg up 'desc("mAEm")'
1083 1082 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
1084 1083 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
1085 1084 $ hg merge 'desc("k-1")'
1086 1085 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1087 1086 (branch merge, don't forget to commit)
1088 1087 $ hg ci -m "mAE,Km: $case_desc"
1089 1088
1090 1089 (merge variant 2)
1091 1090
1092 1091 $ hg up 'desc("k-1")'
1093 1092 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1094 1093 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
1095 1094
1096 1095 $ hg merge 'desc("mAEm")'
1097 1096 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
1098 1097 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
1099 1098 (branch merge, don't forget to commit)
1100 1099 $ hg ci -m "mK,AEm: $case_desc"
1101 1100 created new head
1102 1101
1103 1102 (merge variant 3)
1104 1103
1105 1104 $ hg up 'desc("mEAm")'
1106 1105 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1107 1106 $ hg merge 'desc("j-1")'
1108 1107 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1109 1108 (branch merge, don't forget to commit)
1110 1109 $ echo jj > unrelated-j
1111 1110 $ hg ci -m "mEA,Jm: $case_desc"
1112 1111
1113 1112 (merge variant 4)
1114 1113
1115 1114 $ hg up 'desc("j-1")'
1116 1115 3 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1117 1116 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
1118 1117 $ hg merge 'desc("mEAm")'
1119 1118 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
1120 1119 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
1121 1120 (branch merge, don't forget to commit)
1122 1121 $ echo jj > unrelated-j
1123 1122 $ hg ci -m "mJ,EAm: $case_desc"
1124 1123 created new head
1125 1124
1126 1125
1127 1126 $ hg log -G --rev '::(desc("mAE,Km") + desc("mK,AEm") + desc("mEA,Jm") + desc("mJ,EAm"))'
1128 1127 @ mJ,EAm: chained merges (conflict -> simple) - same content everywhere
1129 1128 |\
1130 1129 +---o mEA,Jm: chained merges (conflict -> simple) - same content everywhere
1131 1130 | |/
1132 1131 | | o mK,AEm: chained merges (conflict -> simple) - same content everywhere
1133 1132 | | |\
1134 1133 | | +---o mAE,Km: chained merges (conflict -> simple) - same content everywhere
1135 1134 | | | |/
1136 1135 | | | o k-1: unrelated changes (based on "e" changes)
1137 1136 | | | |
1138 1137 | o | | j-1: unrelated changes (based on the "a" series of changes)
1139 1138 | | | |
1140 1139 o-----+ mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1141 1140 |/ / /
1142 1141 | o / mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1143 1142 |/|/
1144 1143 | o e-2 g -move-> f
1145 1144 | |
1146 1145 | o e-1 b -move-> g
1147 1146 | |
1148 1147 o | a-2: e -move-> f
1149 1148 | |
1150 1149 o | a-1: d -move-> e
1151 1150 |/
1152 1151 o i-2: c -move-> d, s -move-> t
1153 1152 |
1154 1153 o i-1: a -move-> c, p -move-> s
1155 1154 |
1156 1155 o i-0 initial commit: a b h p q r
1157 1156
1158 1157
1159 1158 Subcase: chaining conflicting rename resolution, with actual merging happening
1160 1159 ``````````````````````````````````````````````````````````````````````````````
1161 1160
1162 1161 The "mPQm" and "mQPm" case create a rename tracking conflict on file 't'. We
1163 1162 add more change on the respective branch and merge again. These second merge
1164 1163 does not involve the file 't' and the arbitration done within "mPQm" and "mQP"
1165 1164 about that file should stay unchanged.
1166 1165
1167 1166 $ case_desc="chained merges (conflict -> simple) - different content"
1168 1167
1169 1168 (extra unrelated changes)
1170 1169
1171 1170 $ hg up 'desc("p-2")'
1172 1171 3 files updated, 0 files merged, 3 files removed, 0 files unresolved
1173 1172 $ echo s > unrelated-s
1174 1173 $ hg add unrelated-s
1175 1174 $ hg ci -m 's-1: unrelated changes (based on the "p" series of changes)'
1176 1175 created new head
1177 1176
1178 1177 $ hg up 'desc("q-2")'
1179 1178 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
1180 1179 $ echo t > unrelated-t
1181 1180 $ hg add unrelated-t
1182 1181 $ hg ci -m 't-1: unrelated changes (based on "q" changes)'
1183 1182 created new head
1184 1183
1185 1184 (merge variant 1)
1186 1185
1187 1186 $ hg up 'desc("mPQm")'
1188 1187 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
1189 1188 $ hg merge 'desc("t-1")'
1190 1189 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1191 1190 (branch merge, don't forget to commit)
1192 1191 $ hg ci -m "mPQ,Tm: $case_desc"
1193 1192
1194 1193 (merge variant 2)
1195 1194
1196 1195 $ hg up 'desc("t-1")'
1197 1196 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1198 1197
1199 1198 $ hg merge 'desc("mPQm")'
1200 1199 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1201 1200 (branch merge, don't forget to commit)
1202 1201 $ hg ci -m "mT,PQm: $case_desc"
1203 1202 created new head
1204 1203
1205 1204 (merge variant 3)
1206 1205
1207 1206 $ hg up 'desc("mQPm")'
1208 1207 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1209 1208 $ hg merge 'desc("s-1")'
1210 1209 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1211 1210 (branch merge, don't forget to commit)
1212 1211 $ hg ci -m "mQP,Sm: $case_desc"
1213 1212
1214 1213 (merge variant 4)
1215 1214
1216 1215 $ hg up 'desc("s-1")'
1217 1216 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1218 1217 $ hg merge 'desc("mQPm")'
1219 1218 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1220 1219 (branch merge, don't forget to commit)
1221 1220 $ hg ci -m "mS,QPm: $case_desc"
1222 1221 created new head
1223 1222 $ hg up null --quiet
1224 1223
1225 1224
1226 1225 $ hg log -G --rev '::(desc("mPQ,Tm") + desc("mT,PQm") + desc("mQP,Sm") + desc("mS,QPm"))'
1227 1226 o mS,QPm: chained merges (conflict -> simple) - different content
1228 1227 |\
1229 1228 +---o mQP,Sm: chained merges (conflict -> simple) - different content
1230 1229 | |/
1231 1230 | | o mT,PQm: chained merges (conflict -> simple) - different content
1232 1231 | | |\
1233 1232 | | +---o mPQ,Tm: chained merges (conflict -> simple) - different content
1234 1233 | | | |/
1235 1234 | | | o t-1: unrelated changes (based on "q" changes)
1236 1235 | | | |
1237 1236 | o | | s-1: unrelated changes (based on the "p" series of changes)
1238 1237 | | | |
1239 1238 o-----+ mQPm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - the other way
1240 1239 |/ / /
1241 1240 | o / mPQm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - one way
1242 1241 |/|/
1243 1242 | o q-2 w -move-> v
1244 1243 | |
1245 1244 | o q-1 r -move-> w
1246 1245 | |
1247 1246 o | p-2: u -move-> v
1248 1247 | |
1249 1248 o | p-1: t -move-> u
1250 1249 |/
1251 1250 o i-2: c -move-> d, s -move-> t
1252 1251 |
1253 1252 o i-1: a -move-> c, p -move-> s
1254 1253 |
1255 1254 o i-0 initial commit: a b h p q r
1256 1255
1257 1256
1258 1257 Subcase: chaining salvage information during a merge
1259 1258 ````````````````````````````````````````````````````
1260 1259
1261 1260 We add more change on the branch were the file was deleted. merging again
1262 1261 should preserve the fact eh file was salvaged.
1263 1262
1264 1263 $ case_desc="chained merges (salvaged -> simple) - same content (when the file exists)"
1265 1264
1266 1265 (creating the change)
1267 1266
1268 1267 $ hg up 'desc("c-1")'
1269 1268 5 files updated, 0 files merged, 0 files removed, 0 files unresolved
1270 1269 $ echo l > unrelated-l
1271 1270 $ hg add unrelated-l
1272 1271 $ hg ci -m 'l-1: unrelated changes (based on "c" changes)'
1273 1272 created new head
1274 1273
1275 1274 (Merge variant 1)
1276 1275
1277 1276 $ hg up 'desc("mBC-revert-m")'
1278 1277 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1279 1278 $ hg merge 'desc("l-1")'
1280 1279 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1281 1280 (branch merge, don't forget to commit)
1282 1281 $ hg ci -m "mBC+revert,Lm: $case_desc"
1283 1282
1284 1283 (Merge variant 2)
1285 1284
1286 1285 $ hg up 'desc("mCB-revert-m")'
1287 1286 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1288 1287 $ hg merge 'desc("l-1")'
1289 1288 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1290 1289 (branch merge, don't forget to commit)
1291 1290 $ hg ci -m "mCB+revert,Lm: $case_desc"
1292 1291
1293 1292 (Merge variant 3)
1294 1293
1295 1294 $ hg up 'desc("l-1")'
1296 1295 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1297 1296
1298 1297 $ hg merge 'desc("mBC-revert-m")'
1299 1298 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1300 1299 (branch merge, don't forget to commit)
1301 1300 $ hg ci -m "mL,BC+revertm: $case_desc"
1302 1301 created new head
1303 1302
1304 1303 (Merge variant 4)
1305 1304
1306 1305 $ hg up 'desc("l-1")'
1307 1306 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1308 1307
1309 1308 $ hg merge 'desc("mCB-revert-m")'
1310 1309 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1311 1310 (branch merge, don't forget to commit)
1312 1311 $ hg ci -m "mL,CB+revertm: $case_desc"
1313 1312 created new head
1314 1313
1315 1314 $ hg log -G --rev '::(desc("mBC+revert,Lm") + desc("mCB+revert,Lm") + desc("mL,BC+revertm") + desc("mL,CB+revertm"))'
1316 1315 @ mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1317 1316 |\
1318 1317 | | o mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1319 1318 | |/|
1320 1319 +-+---o mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1321 1320 | | |
1322 1321 | +---o mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1323 1322 | | |/
1324 1323 | o | l-1: unrelated changes (based on "c" changes)
1325 1324 | | |
1326 1325 | | o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1327 1326 | |/|
1328 1327 o---+ mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1329 1328 |/ /
1330 1329 o | c-1 delete d
1331 1330 | |
1332 1331 | o b-1: b update
1333 1332 |/
1334 1333 o i-2: c -move-> d, s -move-> t
1335 1334 |
1336 1335 o i-1: a -move-> c, p -move-> s
1337 1336 |
1338 1337 o i-0 initial commit: a b h p q r
1339 1338
1340 1339
1341 1340
1342 1341 Subcase: chaining "merged" information during a merge
1343 1342 ``````````````````````````````````````````````````````
1344 1343
1345 1344 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
1346 1345
1347 1346 $ case_desc="chained merges (copy-overwrite -> simple) - same content"
1348 1347
1349 1348 (extra unrelated changes)
1350 1349
1351 1350 $ hg up 'desc("f-2")'
1352 1351 2 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
1353 1352 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
1354 1353 $ echo n > unrelated-n
1355 1354 $ hg add unrelated-n
1356 1355 $ hg ci -m 'n-1: unrelated changes (based on the "f" series of changes)'
1357 1356 created new head
1358 1357
1359 1358 $ hg up 'desc("g-1")'
1360 1359 2 files updated, 0 files merged, 1 files removed, 0 files unresolved
1361 1360 $ echo o > unrelated-o
1362 1361 $ hg add unrelated-o
1363 1362 $ hg ci -m 'o-1: unrelated changes (based on "g" changes)'
1364 1363 created new head
1365 1364
1366 1365 (merge variant 1)
1367 1366
1368 1367 $ hg up 'desc("mFGm")'
1369 1368 1 files updated, 0 files merged, 2 files removed, 0 files unresolved (no-changeset !)
1370 1369 0 files updated, 0 files merged, 2 files removed, 0 files unresolved (changeset !)
1371 1370 $ hg merge 'desc("o-1")'
1372 1371 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1373 1372 (branch merge, don't forget to commit)
1374 1373 $ hg ci -m "mFG,Om: $case_desc"
1375 1374
1376 1375 (merge variant 2)
1377 1376
1378 1377 $ hg up 'desc("o-1")'
1379 1378 2 files updated, 0 files merged, 0 files removed, 0 files unresolved (no-changeset !)
1380 1379 1 files updated, 0 files merged, 0 files removed, 0 files unresolved (changeset !)
1381 1380 $ hg merge 'desc("FGm")'
1382 1381 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !)
1383 1382 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !)
1384 1383 (branch merge, don't forget to commit)
1385 1384 $ hg ci -m "mO,FGm: $case_desc"
1386 1385 created new head
1387 1386
1388 1387 (merge variant 3)
1389 1388
1390 1389 $ hg up 'desc("mGFm")'
1391 1390 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1392 1391 $ hg merge 'desc("n-1")'
1393 1392 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1394 1393 (branch merge, don't forget to commit)
1395 1394 $ hg ci -m "mGF,Nm: $case_desc"
1396 1395
1397 1396 (merge variant 4)
1398 1397
1399 1398 $ hg up 'desc("n-1")'
1400 1399 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1401 1400 $ hg merge 'desc("mGFm")'
1402 1401 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1403 1402 (branch merge, don't forget to commit)
1404 1403 $ hg ci -m "mN,GFm: $case_desc"
1405 1404 created new head
1406 1405
1407 1406 $ hg log -G --rev '::(desc("mFG,Om") + desc("mO,FGm") + desc("mGF,Nm") + desc("mN,GFm"))'
1408 1407 @ mN,GFm: chained merges (copy-overwrite -> simple) - same content
1409 1408 |\
1410 1409 +---o mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1411 1410 | |/
1412 1411 | | o mO,FGm: chained merges (copy-overwrite -> simple) - same content
1413 1412 | | |\
1414 1413 | | +---o mFG,Om: chained merges (copy-overwrite -> simple) - same content
1415 1414 | | | |/
1416 1415 | | | o o-1: unrelated changes (based on "g" changes)
1417 1416 | | | |
1418 1417 | o | | n-1: unrelated changes (based on the "f" series of changes)
1419 1418 | | | |
1420 1419 o-----+ mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1421 1420 |/ / /
1422 1421 | o / mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1423 1422 |/|/
1424 1423 | o g-1: update d
1425 1424 | |
1426 1425 o | f-2: rename i -> d
1427 1426 | |
1428 1427 o | f-1: rename h -> i
1429 1428 |/
1430 1429 o i-2: c -move-> d, s -move-> t
1431 1430 |
1432 1431 o i-1: a -move-> c, p -move-> s
1433 1432 |
1434 1433 o i-0 initial commit: a b h p q r
1435 1434
1436 1435
1437 1436 Subcase: chaining conflicting rename resolution, with extra change during the merge
1438 1437 ```````````````````````````````````````````````````````````````````````````````````
1439 1438
1440 1439 The "mEA-change-m-0" and "mAE-change-m-0" case create a rename tracking conflict on file 'f'. We
1441 1440 add more change on the respective branch and merge again. These second merge
1442 1441 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
1443 1442 about that file should stay unchanged.
1444 1443
1445 1444 $ case_desc="chained merges (conflict+change -> simple) - same content on both branch in the initial merge"
1446 1445
1447 1446
1448 1447 (merge variant 1)
1449 1448
1450 1449 $ hg up 'desc("mAE-change-m")'
1451 1450 2 files updated, 0 files merged, 3 files removed, 0 files unresolved
1452 1451 $ hg merge 'desc("k-1")'
1453 1452 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1454 1453 (branch merge, don't forget to commit)
1455 1454 $ hg ci -m "mAE-change,Km: $case_desc"
1456 1455
1457 1456 (merge variant 2)
1458 1457
1459 1458 $ hg up 'desc("k-1")'
1460 1459 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1461 1460
1462 1461 $ hg merge 'desc("mAE-change-m")'
1463 1462 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1464 1463 (branch merge, don't forget to commit)
1465 1464 $ hg ci -m "mK,AE-change-m: $case_desc"
1466 1465 created new head
1467 1466
1468 1467 (merge variant 3)
1469 1468
1470 1469 $ hg up 'desc("mEA-change-m")'
1471 1470 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1472 1471 $ hg merge 'desc("j-1")'
1473 1472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1474 1473 (branch merge, don't forget to commit)
1475 1474 $ hg ci -m "mEA-change,Jm: $case_desc"
1476 1475
1477 1476 (merge variant 4)
1478 1477
1479 1478 $ hg up 'desc("j-1")'
1480 1479 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1481 1480 $ hg merge 'desc("mEA-change-m")'
1482 1481 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1483 1482 (branch merge, don't forget to commit)
1484 1483 $ hg ci -m "mJ,EA-change-m: $case_desc"
1485 1484 created new head
1486 1485
1487 1486
1488 1487 $ hg log -G --rev '::(desc("mAE-change,Km") + desc("mK,AE-change-m") + desc("mEA-change,Jm") + desc("mJ,EA-change-m"))'
1489 1488 @ mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1490 1489 |\
1491 1490 +---o mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1492 1491 | |/
1493 1492 | | o mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1494 1493 | | |\
1495 1494 | | +---o mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1496 1495 | | | |/
1497 1496 | | | o k-1: unrelated changes (based on "e" changes)
1498 1497 | | | |
1499 1498 | o | | j-1: unrelated changes (based on the "a" series of changes)
1500 1499 | | | |
1501 1500 o-----+ mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1502 1501 |/ / /
1503 1502 | o / mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1504 1503 |/|/
1505 1504 | o e-2 g -move-> f
1506 1505 | |
1507 1506 | o e-1 b -move-> g
1508 1507 | |
1509 1508 o | a-2: e -move-> f
1510 1509 | |
1511 1510 o | a-1: d -move-> e
1512 1511 |/
1513 1512 o i-2: c -move-> d, s -move-> t
1514 1513 |
1515 1514 o i-1: a -move-> c, p -move-> s
1516 1515 |
1517 1516 o i-0 initial commit: a b h p q r
1518 1517
1519 1518
1520 1519 Summary of all created cases
1521 1520 ----------------------------
1522 1521
1523 1522 $ hg up --quiet null
1524 1523
1525 1524 (This exists to help keeping a compact list of the various cases we have built)
1526 1525
1527 1526 $ hg log -T '{desc|firstline}\n'| sort
1528 1527 a-1: d -move-> e
1529 1528 a-2: e -move-> f
1530 1529 b-1: b update
1531 1530 c-1 delete d
1532 1531 d-1 delete d
1533 1532 d-2 re-add d
1534 1533 e-1 b -move-> g
1535 1534 e-2 g -move-> f
1536 1535 f-1: rename h -> i
1537 1536 f-2: rename i -> d
1538 1537 g-1: update d
1539 1538 h-1: b -(move)-> d
1540 1539 i-0 initial commit: a b h p q r
1541 1540 i-1: a -move-> c, p -move-> s
1542 1541 i-2: c -move-> d, s -move-> t
1543 1542 j-1: unrelated changes (based on the "a" series of changes)
1544 1543 k-1: unrelated changes (based on "e" changes)
1545 1544 l-1: unrelated changes (based on "c" changes)
1546 1545 mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
1547 1546 mAE,Km: chained merges (conflict -> simple) - same content everywhere
1548 1547 mAE-change,Km: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1549 1548 mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
1550 1549 mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
1551 1550 mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
1552 1551 mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1553 1552 mBC-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1554 1553 mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
1555 1554 mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
1556 1555 mBCm-1 re-add d
1557 1556 mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
1558 1557 mBF-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1559 1558 mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
1560 1559 mBRm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - one way
1561 1560 mCB+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists)
1562 1561 mCB-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1563 1562 mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
1564 1563 mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
1565 1564 mCBm-1 re-add d
1566 1565 mCGm-0 merge updated/deleted - revive the file (updated content) - one way
1567 1566 mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
1568 1567 mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
1569 1568 mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
1570 1569 mEA,Jm: chained merges (conflict -> simple) - same content everywhere
1571 1570 mEA-change,Jm: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1572 1571 mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
1573 1572 mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
1574 1573 mFB-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1575 1574 mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
1576 1575 mFG,Om: chained merges (copy-overwrite -> simple) - same content
1577 1576 mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
1578 1577 mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
1579 1578 mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
1580 1579 mGF,Nm: chained merges (copy-overwrite -> simple) - same content
1581 1580 mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
1582 1581 mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
1583 1582 mJ,EA-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1584 1583 mJ,EAm: chained merges (conflict -> simple) - same content everywhere
1585 1584 mK,AE-change-m: chained merges (conflict+change -> simple) - same content on both branch in the initial merge
1586 1585 mK,AEm: chained merges (conflict -> simple) - same content everywhere
1587 1586 mL,BC+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1588 1587 mL,CB+revertm: chained merges (salvaged -> simple) - same content (when the file exists)
1589 1588 mN,GFm: chained merges (copy-overwrite -> simple) - same content
1590 1589 mO,FGm: chained merges (copy-overwrite -> simple) - same content
1591 1590 mPQ,Tm: chained merges (conflict -> simple) - different content
1592 1591 mPQm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - one way
1593 1592 mQP,Sm: chained merges (conflict -> simple) - different content
1594 1593 mQPm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - the other way
1595 1594 mRBm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - the other way
1596 1595 mS,QPm: chained merges (conflict -> simple) - different content
1597 1596 mT,PQm: chained merges (conflict -> simple) - different content
1598 1597 n-1: unrelated changes (based on the "f" series of changes)
1599 1598 o-1: unrelated changes (based on "g" changes)
1600 1599 p-1: t -move-> u
1601 1600 p-2: u -move-> v
1602 1601 q-1 r -move-> w
1603 1602 q-2 w -move-> v
1604 1603 r-1: rename r -> x
1605 1604 r-2: rename t -> x
1606 1605 s-1: unrelated changes (based on the "p" series of changes)
1607 1606 t-1: unrelated changes (based on "q" changes)
1608 1607
1609 1608
1610 1609 Test that sidedata computations during upgrades are correct
1611 1610 ===========================================================
1612 1611
1613 1612 We upgrade a repository that is not using sidedata (the filelog case) and
1614 1613 check that the same side data have been generated as if they were computed at
1615 1614 commit time.
1616 1615
1617 1616
1618 1617 #if upgraded
1619 1618 $ cat >> $HGRCPATH << EOF
1620 1619 > [format]
1621 1620 > exp-use-side-data = yes
1622 1621 > exp-use-copies-side-data-changeset = yes
1623 1622 > EOF
1624 1623 $ hg debugformat -v
1625 1624 format-variant repo config default
1626 1625 fncache: yes yes yes
1627 1626 dotencode: yes yes yes
1628 1627 generaldelta: yes yes yes
1629 1628 share-safe: no no no
1630 1629 sparserevlog: yes yes yes
1631 1630 persistent-nodemap: no no no (no-rust !)
1632 1631 persistent-nodemap: yes yes no (rust !)
1633 1632 copies-sdc: no yes no
1634 1633 revlog-v2: no yes no
1635 1634 plain-cl-delta: yes yes yes
1636 1635 compression: * (glob)
1637 1636 compression-level: default default default
1638 1637 $ hg debugupgraderepo --run --quiet
1639 1638 upgrade will perform the following actions:
1640 1639
1641 1640 requirements
1642 1641 preserved: * (glob)
1643 1642 removed: revlogv1
1644 1643 added: exp-copies-sidedata-changeset, exp-revlogv2.2, exp-sidedata-flag
1645 1644
1646 1645 processed revlogs:
1647 1646 - all-filelogs
1648 1647 - changelog
1649 1648 - manifest
1650 1649
1651 1650 #endif
1652 1651
1653 1652 #if upgraded-parallel
1654 1653 $ cat >> $HGRCPATH << EOF
1655 1654 > [format]
1656 1655 > exp-use-side-data = yes
1657 1656 > exp-use-copies-side-data-changeset = yes
1658 1657 > [experimental]
1659 1658 > worker.repository-upgrade=yes
1660 1659 > [worker]
1661 1660 > enabled=yes
1662 1661 > numcpus=8
1663 1662 > EOF
1664 1663 $ hg debugformat -v
1665 1664 format-variant repo config default
1666 1665 fncache: yes yes yes
1667 1666 dotencode: yes yes yes
1668 1667 generaldelta: yes yes yes
1669 1668 share-safe: no no no
1670 1669 sparserevlog: yes yes yes
1671 1670 persistent-nodemap: no no no (no-rust !)
1672 1671 persistent-nodemap: yes yes no (rust !)
1673 1672 copies-sdc: no yes no
1674 1673 revlog-v2: no yes no
1675 1674 plain-cl-delta: yes yes yes
1676 1675 compression: * (glob)
1677 1676 compression-level: default default default
1678 1677 $ hg debugupgraderepo --run --quiet
1679 1678 upgrade will perform the following actions:
1680 1679
1681 1680 requirements
1682 1681 preserved: * (glob)
1683 1682 removed: revlogv1
1684 1683 added: exp-copies-sidedata-changeset, exp-revlogv2.2, exp-sidedata-flag
1685 1684
1686 1685 processed revlogs:
1687 1686 - all-filelogs
1688 1687 - changelog
1689 1688 - manifest
1690 1689
1691 1690 #endif
1692 1691
1693 1692
1694 1693 #if no-compatibility no-filelog no-changeset
1695 1694
1696 1695 $ hg debugchangedfiles --compute 0
1697 1696 added : a, ;
1698 1697 added : b, ;
1699 1698 added : h, ;
1700 1699 added : p, ;
1701 1700 added : q, ;
1702 1701 added : r, ;
1703 1702
1704 1703 $ for rev in `hg log --rev 'all()' -T '{rev}\n'`; do
1705 1704 > case_id=`hg log -r $rev -T '{word(0, desc, ":")}\n'`
1706 1705 > echo "##### revision \"$case_id\" #####"
1707 1706 > hg debugsidedata -c -v -- $rev
1708 1707 > hg debugchangedfiles $rev
1709 1708 > done
1710 1709 ##### revision "i-0 initial commit" #####
1711 1710 1 sidedata entries
1712 1711 entry-0014 size 64
1713 1712 '\x00\x00\x00\x06\x04\x00\x00\x00\x01\x00\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x04\x00\x00\x00\x03\x00\x00\x00\x00\x04\x00\x00\x00\x04\x00\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x00\x04\x00\x00\x00\x06\x00\x00\x00\x00abhpqr'
1714 1713 added : a, ;
1715 1714 added : b, ;
1716 1715 added : h, ;
1717 1716 added : p, ;
1718 1717 added : q, ;
1719 1718 added : r, ;
1720 1719 ##### revision "i-1" #####
1721 1720 1 sidedata entries
1722 1721 entry-0014 size 44
1723 1722 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02acps'
1724 1723 removed : a, ;
1725 1724 added p1: c, a;
1726 1725 removed : p, ;
1727 1726 added p1: s, p;
1728 1727 ##### revision "i-2" #####
1729 1728 1 sidedata entries
1730 1729 entry-0014 size 44
1731 1730 '\x00\x00\x00\x04\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00\x0c\x00\x00\x00\x03\x00\x00\x00\x00\x06\x00\x00\x00\x04\x00\x00\x00\x02cdst'
1732 1731 removed : c, ;
1733 1732 added p1: d, c;
1734 1733 removed : s, ;
1735 1734 added p1: t, s;
1736 1735 ##### revision "a-1" #####
1737 1736 1 sidedata entries
1738 1737 entry-0014 size 24
1739 1738 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00de'
1740 1739 removed : d, ;
1741 1740 added p1: e, d;
1742 1741 ##### revision "a-2" #####
1743 1742 1 sidedata entries
1744 1743 entry-0014 size 24
1745 1744 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00ef'
1746 1745 removed : e, ;
1747 1746 added p1: f, e;
1748 1747 ##### revision "b-1" #####
1749 1748 1 sidedata entries
1750 1749 entry-0014 size 14
1751 1750 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00b'
1752 1751 touched : b, ;
1753 1752 ##### revision "c-1 delete d" #####
1754 1753 1 sidedata entries
1755 1754 entry-0014 size 14
1756 1755 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1757 1756 removed : d, ;
1758 1757 ##### revision "d-1 delete d" #####
1759 1758 1 sidedata entries
1760 1759 entry-0014 size 14
1761 1760 '\x00\x00\x00\x01\x0c\x00\x00\x00\x01\x00\x00\x00\x00d'
1762 1761 removed : d, ;
1763 1762 ##### revision "d-2 re-add d" #####
1764 1763 1 sidedata entries
1765 1764 entry-0014 size 14
1766 1765 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1767 1766 added : d, ;
1768 1767 ##### revision "e-1 b -move-> g" #####
1769 1768 1 sidedata entries
1770 1769 entry-0014 size 24
1771 1770 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bg'
1772 1771 removed : b, ;
1773 1772 added p1: g, b;
1774 1773 ##### revision "e-2 g -move-> f" #####
1775 1774 1 sidedata entries
1776 1775 entry-0014 size 24
1777 1776 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00fg'
1778 1777 added p1: f, g;
1779 1778 removed : g, ;
1780 1779 ##### revision "p-1" #####
1781 1780 1 sidedata entries
1782 1781 entry-0014 size 24
1783 1782 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00tu'
1784 1783 removed : t, ;
1785 1784 added p1: u, t;
1786 1785 ##### revision "p-2" #####
1787 1786 1 sidedata entries
1788 1787 entry-0014 size 24
1789 1788 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00uv'
1790 1789 removed : u, ;
1791 1790 added p1: v, u;
1792 1791 ##### revision "q-1 r -move-> w" #####
1793 1792 1 sidedata entries
1794 1793 entry-0014 size 24
1795 1794 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00rw'
1796 1795 removed : r, ;
1797 1796 added p1: w, r;
1798 1797 ##### revision "q-2 w -move-> v" #####
1799 1798 1 sidedata entries
1800 1799 entry-0014 size 24
1801 1800 '\x00\x00\x00\x02\x06\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00vw'
1802 1801 added p1: v, w;
1803 1802 removed : w, ;
1804 1803 ##### revision "mBAm-0 simple merge - A side" #####
1805 1804 1 sidedata entries
1806 1805 entry-0014 size 4
1807 1806 '\x00\x00\x00\x00'
1808 1807 ##### revision "mABm-0 simple merge - A side" #####
1809 1808 1 sidedata entries
1810 1809 entry-0014 size 4
1811 1810 '\x00\x00\x00\x00'
1812 1811 ##### revision "mBCm-0 simple merge - C side" #####
1813 1812 1 sidedata entries
1814 1813 entry-0014 size 4
1815 1814 '\x00\x00\x00\x00'
1816 1815 ##### revision "mBCm-1 re-add d" #####
1817 1816 1 sidedata entries
1818 1817 entry-0014 size 14
1819 1818 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1820 1819 added : d, ;
1821 1820 ##### revision "mCBm-0 simple merge - C side" #####
1822 1821 1 sidedata entries
1823 1822 entry-0014 size 4
1824 1823 '\x00\x00\x00\x00'
1825 1824 ##### revision "mCBm-1 re-add d" #####
1826 1825 1 sidedata entries
1827 1826 entry-0014 size 14
1828 1827 '\x00\x00\x00\x01\x04\x00\x00\x00\x01\x00\x00\x00\x00d'
1829 1828 added : d, ;
1830 1829 ##### revision "mBDm-0 simple merge - B side" #####
1831 1830 1 sidedata entries
1832 1831 entry-0014 size 4
1833 1832 '\x00\x00\x00\x00'
1834 1833 ##### revision "mDBm-0 simple merge - B side" #####
1835 1834 1 sidedata entries
1836 1835 entry-0014 size 4
1837 1836 '\x00\x00\x00\x00'
1838 1837 ##### revision "mAEm-0 merge with copies info on both side - A side" #####
1839 1838 1 sidedata entries
1840 1839 entry-0014 size 14
1841 1840 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1842 1841 merged : f, ;
1843 1842 ##### revision "mEAm-0 merge with copies info on both side - A side" #####
1844 1843 1 sidedata entries
1845 1844 entry-0014 size 14
1846 1845 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1847 1846 merged : f, ;
1848 1847 ##### revision "mPQm-0 merge with copies info on both side - P side" #####
1849 1848 1 sidedata entries
1850 1849 entry-0014 size 14
1851 1850 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00v'
1852 1851 merged : v, ;
1853 1852 ##### revision "mQPm-0 merge with copies info on both side - P side" #####
1854 1853 1 sidedata entries
1855 1854 entry-0014 size 14
1856 1855 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00v'
1857 1856 merged : v, ;
1858 1857 ##### revision "f-1" #####
1859 1858 1 sidedata entries
1860 1859 entry-0014 size 24
1861 1860 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00hi'
1862 1861 removed : h, ;
1863 1862 added p1: i, h;
1864 1863 ##### revision "f-2" #####
1865 1864 1 sidedata entries
1866 1865 entry-0014 size 24
1867 1866 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00di'
1868 1867 touched p1: d, i;
1869 1868 removed : i, ;
1870 1869 ##### revision "mBFm-0 simple merge - B side" #####
1871 1870 1 sidedata entries
1872 1871 entry-0014 size 4
1873 1872 '\x00\x00\x00\x00'
1874 1873 ##### revision "mFBm-0 simple merge - B side" #####
1875 1874 1 sidedata entries
1876 1875 entry-0014 size 4
1877 1876 '\x00\x00\x00\x00'
1878 1877 ##### revision "r-1" #####
1879 1878 1 sidedata entries
1880 1879 entry-0014 size 24
1881 1880 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00rx'
1882 1881 removed : r, ;
1883 1882 added p1: x, r;
1884 1883 ##### revision "r-2" #####
1885 1884 1 sidedata entries
1886 1885 entry-0014 size 24
1887 1886 '\x00\x00\x00\x02\x16\x00\x00\x00\x01\x00\x00\x00\x01\x0c\x00\x00\x00\x02\x00\x00\x00\x00tx'
1888 1887 touched p1: t, x;
1889 1888 removed : x, ;
1890 1889 ##### revision "mBRm-0 simple merge - B side" #####
1891 1890 1 sidedata entries
1892 1891 entry-0014 size 4
1893 1892 '\x00\x00\x00\x00'
1894 1893 ##### revision "mRBm-0 simple merge - B side" #####
1895 1894 1 sidedata entries
1896 1895 entry-0014 size 4
1897 1896 '\x00\x00\x00\x00'
1898 1897 ##### revision "g-1" #####
1899 1898 1 sidedata entries
1900 1899 entry-0014 size 14
1901 1900 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
1902 1901 touched : d, ;
1903 1902 ##### revision "mDGm-0 actual content merge, copies on one side - D side" #####
1904 1903 1 sidedata entries
1905 1904 entry-0014 size 14
1906 1905 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1907 1906 merged : d, ;
1908 1907 ##### revision "mGDm-0 actual content merge, copies on one side - D side" #####
1909 1908 1 sidedata entries
1910 1909 entry-0014 size 14
1911 1910 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1912 1911 merged : d, ;
1913 1912 ##### revision "mFGm-0 merge - G side" #####
1914 1913 1 sidedata entries
1915 1914 entry-0014 size 14
1916 1915 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1917 1916 merged : d, ;
1918 1917 ##### revision "mGFm-0 merge - G side" #####
1919 1918 1 sidedata entries
1920 1919 entry-0014 size 14
1921 1920 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00d'
1922 1921 merged : d, ;
1923 1922 ##### revision "mCGm-0 merge updated/deleted - revive the file (updated content) - one way" #####
1924 1923 1 sidedata entries
1925 1924 entry-0014 size 14
1926 1925 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1927 1926 salvaged : d, ;
1928 1927 ##### revision "mGCm-0 merge updated/deleted - revive the file (updated content) - the other way" #####
1929 1928 1 sidedata entries
1930 1929 entry-0014 size 14
1931 1930 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1932 1931 salvaged : d, ;
1933 1932 ##### revision "mCB-revert-m-0 merge explicitely revive deleted file - B side" #####
1934 1933 1 sidedata entries
1935 1934 entry-0014 size 14
1936 1935 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1937 1936 salvaged : d, ;
1938 1937 ##### revision "mBC-revert-m-0 merge explicitely revive deleted file - B side" #####
1939 1938 1 sidedata entries
1940 1939 entry-0014 size 14
1941 1940 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1942 1941 salvaged : d, ;
1943 1942 ##### revision "h-1" #####
1944 1943 1 sidedata entries
1945 1944 entry-0014 size 24
1946 1945 '\x00\x00\x00\x02\x0c\x00\x00\x00\x01\x00\x00\x00\x00\x06\x00\x00\x00\x02\x00\x00\x00\x00bd'
1947 1946 removed : b, ;
1948 1947 added p1: d, b;
1949 1948 ##### revision "mCH-delete-before-conflict-m-0 simple merge - C side" #####
1950 1949 1 sidedata entries
1951 1950 entry-0014 size 4
1952 1951 '\x00\x00\x00\x00'
1953 1952 ##### revision "mHC-delete-before-conflict-m-0 simple merge - C side" #####
1954 1953 1 sidedata entries
1955 1954 entry-0014 size 4
1956 1955 '\x00\x00\x00\x00'
1957 1956 ##### revision "mAE-change-m-0 merge with file update and copies info on both side - A side" #####
1958 1957 1 sidedata entries
1959 1958 entry-0014 size 14
1960 1959 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1961 1960 merged : f, ;
1962 1961 ##### revision "mEA-change-m-0 merge with file update and copies info on both side - A side" #####
1963 1962 1 sidedata entries
1964 1963 entry-0014 size 14
1965 1964 '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f'
1966 1965 merged : f, ;
1967 1966 ##### revision "mBF-change-m-0 merge with extra change - B side" #####
1968 1967 1 sidedata entries
1969 1968 entry-0014 size 14
1970 1969 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
1971 1970 touched : d, ;
1972 1971 ##### revision "mFB-change-m-0 merge with extra change - B side" #####
1973 1972 1 sidedata entries
1974 1973 entry-0014 size 14
1975 1974 '\x00\x00\x00\x01\x14\x00\x00\x00\x01\x00\x00\x00\x00d'
1976 1975 touched : d, ;
1977 1976 ##### revision "mCB-change-m-0 merge explicitely revive deleted file - B side" #####
1978 1977 1 sidedata entries
1979 1978 entry-0014 size 14
1980 1979 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1981 1980 salvaged : d, ;
1982 1981 ##### revision "mBC-change-m-0 merge explicitely revive deleted file - B side" #####
1983 1982 1 sidedata entries
1984 1983 entry-0014 size 14
1985 1984 '\x00\x00\x00\x01\x10\x00\x00\x00\x01\x00\x00\x00\x00d'
1986 1985 salvaged : d, ;
1987 1986 ##### revision "j-1" #####
1988 1987 1 sidedata entries
1989 1988 entry-0014 size 24
1990 1989 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-j'
1991 1990 added : unrelated-j, ;
1992 1991 ##### revision "k-1" #####
1993 1992 1 sidedata entries
1994 1993 entry-0014 size 24
1995 1994 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-k'
1996 1995 added : unrelated-k, ;
1997 1996 ##### revision "mAE,Km" #####
1998 1997 1 sidedata entries
1999 1998 entry-0014 size 4
2000 1999 '\x00\x00\x00\x00'
2001 2000 ##### revision "mK,AEm" #####
2002 2001 1 sidedata entries
2003 2002 entry-0014 size 4
2004 2003 '\x00\x00\x00\x00'
2005 2004 ##### revision "mEA,Jm" #####
2006 2005 1 sidedata entries
2007 2006 entry-0014 size 24
2008 2007 '\x00\x00\x00\x01\x14\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-j'
2009 2008 touched : unrelated-j, ;
2010 2009 ##### revision "mJ,EAm" #####
2011 2010 1 sidedata entries
2012 2011 entry-0014 size 24
2013 2012 '\x00\x00\x00\x01\x14\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-j'
2014 2013 touched : unrelated-j, ;
2015 2014 ##### revision "s-1" #####
2016 2015 1 sidedata entries
2017 2016 entry-0014 size 24
2018 2017 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-s'
2019 2018 added : unrelated-s, ;
2020 2019 ##### revision "t-1" #####
2021 2020 1 sidedata entries
2022 2021 entry-0014 size 24
2023 2022 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-t'
2024 2023 added : unrelated-t, ;
2025 2024 ##### revision "mPQ,Tm" #####
2026 2025 1 sidedata entries
2027 2026 entry-0014 size 4
2028 2027 '\x00\x00\x00\x00'
2029 2028 ##### revision "mT,PQm" #####
2030 2029 1 sidedata entries
2031 2030 entry-0014 size 4
2032 2031 '\x00\x00\x00\x00'
2033 2032 ##### revision "mQP,Sm" #####
2034 2033 1 sidedata entries
2035 2034 entry-0014 size 4
2036 2035 '\x00\x00\x00\x00'
2037 2036 ##### revision "mS,QPm" #####
2038 2037 1 sidedata entries
2039 2038 entry-0014 size 4
2040 2039 '\x00\x00\x00\x00'
2041 2040 ##### revision "l-1" #####
2042 2041 1 sidedata entries
2043 2042 entry-0014 size 24
2044 2043 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-l'
2045 2044 added : unrelated-l, ;
2046 2045 ##### revision "mBC+revert,Lm" #####
2047 2046 1 sidedata entries
2048 2047 entry-0014 size 4
2049 2048 '\x00\x00\x00\x00'
2050 2049 ##### revision "mCB+revert,Lm" #####
2051 2050 1 sidedata entries
2052 2051 entry-0014 size 4
2053 2052 '\x00\x00\x00\x00'
2054 2053 ##### revision "mL,BC+revertm" #####
2055 2054 1 sidedata entries
2056 2055 entry-0014 size 4
2057 2056 '\x00\x00\x00\x00'
2058 2057 ##### revision "mL,CB+revertm" #####
2059 2058 1 sidedata entries
2060 2059 entry-0014 size 4
2061 2060 '\x00\x00\x00\x00'
2062 2061 ##### revision "n-1" #####
2063 2062 1 sidedata entries
2064 2063 entry-0014 size 24
2065 2064 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-n'
2066 2065 added : unrelated-n, ;
2067 2066 ##### revision "o-1" #####
2068 2067 1 sidedata entries
2069 2068 entry-0014 size 24
2070 2069 '\x00\x00\x00\x01\x04\x00\x00\x00\x0b\x00\x00\x00\x00unrelated-o'
2071 2070 added : unrelated-o, ;
2072 2071 ##### revision "mFG,Om" #####
2073 2072 1 sidedata entries
2074 2073 entry-0014 size 4
2075 2074 '\x00\x00\x00\x00'
2076 2075 ##### revision "mO,FGm" #####
2077 2076 1 sidedata entries
2078 2077 entry-0014 size 4
2079 2078 '\x00\x00\x00\x00'
2080 2079 ##### revision "mGF,Nm" #####
2081 2080 1 sidedata entries
2082 2081 entry-0014 size 4
2083 2082 '\x00\x00\x00\x00'
2084 2083 ##### revision "mN,GFm" #####
2085 2084 1 sidedata entries
2086 2085 entry-0014 size 4
2087 2086 '\x00\x00\x00\x00'
2088 2087 ##### revision "mAE-change,Km" #####
2089 2088 1 sidedata entries
2090 2089 entry-0014 size 4
2091 2090 '\x00\x00\x00\x00'
2092 2091 ##### revision "mK,AE-change-m" #####
2093 2092 1 sidedata entries
2094 2093 entry-0014 size 4
2095 2094 '\x00\x00\x00\x00'
2096 2095 ##### revision "mEA-change,Jm" #####
2097 2096 1 sidedata entries
2098 2097 entry-0014 size 4
2099 2098 '\x00\x00\x00\x00'
2100 2099 ##### revision "mJ,EA-change-m" #####
2101 2100 1 sidedata entries
2102 2101 entry-0014 size 4
2103 2102 '\x00\x00\x00\x00'
2104 2103
2105 2104 #endif
2106 2105
2107 2106
2108 2107 Test copy information chaining
2109 2108 ==============================
2110 2109
2111 2110 Check that matching only affect the destination and not intermediate path
2112 2111 -------------------------------------------------------------------------
2113 2112
2114 2113 The two status call should give the same value for f
2115 2114
2116 2115 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")'
2117 2116 A f
2118 2117 a
2119 2118 A t
2120 2119 p
2121 2120 R a
2122 2121 R p
2123 2122 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("a-2")' f
2124 2123 A f
2125 2124 a (no-changeset no-compatibility !)
2126 2125
2127 2126 merging with unrelated change does not interfere with the renames
2128 2127 ---------------------------------------------------------------
2129 2128
2130 2129 - rename on one side
2131 2130 - unrelated change on the other side
2132 2131
2133 2132 $ hg log -G --rev '::(desc("mABm")+desc("mBAm"))'
2134 2133 o mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way
2135 2134 |\
2136 2135 +---o mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way
2137 2136 | |/
2138 2137 | o b-1: b update
2139 2138 | |
2140 2139 o | a-2: e -move-> f
2141 2140 | |
2142 2141 o | a-1: d -move-> e
2143 2142 |/
2144 2143 o i-2: c -move-> d, s -move-> t
2145 2144 |
2146 2145 o i-1: a -move-> c, p -move-> s
2147 2146 |
2148 2147 o i-0 initial commit: a b h p q r
2149 2148
2150 2149
2151 2150 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mABm")'
2152 2151 A f
2153 2152 d
2154 2153 R d
2155 2154 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBAm")'
2156 2155 A f
2157 2156 d
2158 2157 R d
2159 2158 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mABm")'
2160 2159 M b
2161 2160 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mBAm")'
2162 2161 M b
2163 2162 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mABm")'
2164 2163 M b
2165 2164 A f
2166 2165 d
2167 2166 R d
2168 2167 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBAm")'
2169 2168 M b
2170 2169 A f
2171 2170 d
2172 2171 R d
2173 2172 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mABm")'
2174 2173 M b
2175 2174 A f
2176 2175 a
2177 2176 A t
2178 2177 p
2179 2178 R a
2180 2179 R p
2181 2180 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBAm")'
2182 2181 M b
2183 2182 A f
2184 2183 a
2185 2184 A t
2186 2185 p
2187 2186 R a
2188 2187 R p
2189 2188
2190 2189 merging with the side having a delete
2191 2190 -------------------------------------
2192 2191
2193 2192 case summary:
2194 2193 - one with change to an unrelated file
2195 2194 - one deleting the change
2196 2195 and recreate an unrelated file after the merge
2197 2196
2198 2197 $ hg log -G --rev '::(desc("mCBm")+desc("mBCm"))'
2199 2198 o mCBm-1 re-add d
2200 2199 |
2201 2200 o mCBm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - the other way
2202 2201 |\
2203 2202 | | o mBCm-1 re-add d
2204 2203 | | |
2205 2204 +---o mBCm-0 simple merge - C side: delete a file with copies history , B side: unrelated update - one way
2206 2205 | |/
2207 2206 | o c-1 delete d
2208 2207 | |
2209 2208 o | b-1: b update
2210 2209 |/
2211 2210 o i-2: c -move-> d, s -move-> t
2212 2211 |
2213 2212 o i-1: a -move-> c, p -move-> s
2214 2213 |
2215 2214 o i-0 initial commit: a b h p q r
2216 2215
2217 2216 - comparing from the merge
2218 2217
2219 2218 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-0")'
2220 2219 R d
2221 2220 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-0")'
2222 2221 R d
2223 2222 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-0")'
2224 2223 M b
2225 2224 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-0")'
2226 2225 M b
2227 2226 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-0")'
2228 2227 M b
2229 2228 R d
2230 2229 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-0")'
2231 2230 M b
2232 2231 R d
2233 2232 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-0")'
2234 2233 M b
2235 2234 A t
2236 2235 p
2237 2236 R a
2238 2237 R p
2239 2238 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-0")'
2240 2239 M b
2241 2240 A t
2242 2241 p
2243 2242 R a
2244 2243 R p
2245 2244
2246 2245 - comparing with the merge children re-adding the file
2247 2246
2248 2247 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBCm-1")'
2249 2248 M d
2250 2249 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCBm-1")'
2251 2250 M d
2252 2251 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBCm-1")'
2253 2252 M b
2254 2253 A d
2255 2254 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCBm-1")'
2256 2255 M b
2257 2256 A d
2258 2257 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBCm-1")'
2259 2258 M b
2260 2259 M d
2261 2260 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mCBm-1")'
2262 2261 M b
2263 2262 M d
2264 2263 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBCm-1")'
2265 2264 M b
2266 2265 A d
2267 2266 A t
2268 2267 p
2269 2268 R a
2270 2269 R p
2271 2270 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCBm-1")'
2272 2271 M b
2273 2272 A d
2274 2273 A t
2275 2274 p
2276 2275 R a
2277 2276 R p
2278 2277
2279 2278 Comparing with a merge re-adding the file afterward
2280 2279 ---------------------------------------------------
2281 2280
2282 2281 Merge:
2283 2282 - one with change to an unrelated file
2284 2283 - one deleting and recreating the change
2285 2284
2286 2285 $ hg log -G --rev '::(desc("mDBm")+desc("mBDm"))'
2287 2286 o mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way
2288 2287 |\
2289 2288 +---o mBDm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - one way
2290 2289 | |/
2291 2290 | o d-2 re-add d
2292 2291 | |
2293 2292 | o d-1 delete d
2294 2293 | |
2295 2294 o | b-1: b update
2296 2295 |/
2297 2296 o i-2: c -move-> d, s -move-> t
2298 2297 |
2299 2298 o i-1: a -move-> c, p -move-> s
2300 2299 |
2301 2300 o i-0 initial commit: a b h p q r
2302 2301
2303 2302 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBDm-0")'
2304 2303 M d
2305 2304 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mDBm-0")'
2306 2305 M d
2307 2306 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mBDm-0")'
2308 2307 M b
2309 2308 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDBm-0")'
2310 2309 M b
2311 2310 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mBDm-0")'
2312 2311 M b
2313 2312 M d
2314 2313 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mDBm-0")'
2315 2314 M b
2316 2315 M d
2317 2316
2318 2317 The bugs makes recorded copy is different depending of where we started the merge from since
2319 2318
2320 2319 $ hg manifest --debug --rev 'desc("mBDm-0")' | grep '644 d'
2321 2320 b004912a8510032a0350a74daa2803dadfb00e12 644 d
2322 2321 $ hg manifest --debug --rev 'desc("mDBm-0")' | grep '644 d'
2323 2322 b004912a8510032a0350a74daa2803dadfb00e12 644 d
2324 2323
2325 2324 $ hg manifest --debug --rev 'desc("d-2")' | grep '644 d'
2326 2325 b004912a8510032a0350a74daa2803dadfb00e12 644 d
2327 2326 $ hg manifest --debug --rev 'desc("b-1")' | grep '644 d'
2328 2327 d8252ab2e760b0d4e5288fd44cbd15a0fa567e16 644 d (no-changeset !)
2329 2328 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
2330 $ hg debugindex d | head -n 4 | ../no-linkrev
2329 $ hg debugindex d | head -n 4 | "$PYTHON" ../no-linkrev
2331 2330 rev linkrev nodeid p1 p2
2332 2331 0 * d8252ab2e760 000000000000 000000000000 (no-changeset !)
2333 2332 0 * ae258f702dfe 000000000000 000000000000 (changeset !)
2334 2333 1 * b004912a8510 000000000000 000000000000
2335 2334 2 * 7b79e2fe0c89 000000000000 000000000000 (no-changeset !)
2336 2335 2 * 5cce88bf349f ae258f702dfe 000000000000 (changeset !)
2337 2336
2338 2337 Log output should not include a merge commit as it did not happen
2339 2338
2340 2339 $ hg log -Gfr 'desc("mBDm-0")' d
2341 2340 o d-2 re-add d
2342 2341 |
2343 2342 ~
2344 2343
2345 2344 $ hg log -Gfr 'desc("mDBm-0")' d
2346 2345 o d-2 re-add d
2347 2346 |
2348 2347 ~
2349 2348
2350 2349 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBDm-0")'
2351 2350 M b
2352 2351 A d
2353 2352 A t
2354 2353 p
2355 2354 R a
2356 2355 R p
2357 2356 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDBm-0")'
2358 2357 M b
2359 2358 A d
2360 2359 A t
2361 2360 p
2362 2361 R a
2363 2362 R p
2364 2363
2365 2364
2366 2365 Comparing with a merge with colliding rename
2367 2366 --------------------------------------------
2368 2367
2369 2368 Subcase: new copy information on both side
2370 2369 ``````````````````````````````````````````
2371 2370
2372 2371 - the "e-" branch renaming b to f (through 'g')
2373 2372 - the "a-" branch renaming d to f (through e)
2374 2373
2375 2374 $ hg log -G --rev '::(desc("mAEm")+desc("mEAm"))'
2376 2375 o mEAm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - the other way
2377 2376 |\
2378 2377 +---o mAEm-0 merge with copies info on both side - A side: rename d to f, E side: b to f, (same content for f) - one way
2379 2378 | |/
2380 2379 | o e-2 g -move-> f
2381 2380 | |
2382 2381 | o e-1 b -move-> g
2383 2382 | |
2384 2383 o | a-2: e -move-> f
2385 2384 | |
2386 2385 o | a-1: d -move-> e
2387 2386 |/
2388 2387 o i-2: c -move-> d, s -move-> t
2389 2388 |
2390 2389 o i-1: a -move-> c, p -move-> s
2391 2390 |
2392 2391 o i-0 initial commit: a b h p q r
2393 2392
2394 2393 #if no-changeset
2395 2394 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
2396 2395 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
2397 2396 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
2398 2397 2ff93c643948464ee1f871867910ae43a45b0bea 644 f
2399 2398 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2400 2399 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
2401 2400 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2402 2401 e8825b386367b29fec957283a80bb47b47483fe1 644 f
2403 $ hg debugindex f | ../no-linkrev
2402 $ hg debugindex f | "$PYTHON" ../no-linkrev
2404 2403 rev linkrev nodeid p1 p2
2405 2404 0 * b76eb76580df 000000000000 000000000000
2406 2405 1 * e8825b386367 000000000000 000000000000
2407 2406 2 * 2ff93c643948 b76eb76580df e8825b386367
2408 2407 3 * 2f649fba7eb2 b76eb76580df e8825b386367
2409 2408 4 * 774e7c1637d5 e8825b386367 b76eb76580df
2410 2409 #else
2411 2410 $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f'
2412 2411 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2413 2412 $ hg manifest --debug --rev 'desc("mEAm-0")' | grep '644 f'
2414 2413 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2415 2414 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
2416 2415 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2417 2416 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
2418 2417 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
2419 $ hg debugindex f | ../no-linkrev
2418 $ hg debugindex f | "$PYTHON" ../no-linkrev
2420 2419 rev linkrev nodeid p1 p2
2421 2420 0 * ae258f702dfe 000000000000 000000000000
2422 2421 1 * d3613c1ec831 ae258f702dfe 000000000000
2423 2422 2 * 05e03c868bbc ae258f702dfe 000000000000
2424 2423 #endif
2425 2424
2426 2425 # Here the filelog based implementation is not looking at the rename
2427 2426 # information (because the file exist on both side). However the changelog
2428 2427 # based on works fine. We have different output.
2429 2428
2430 2429 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAEm-0")'
2431 2430 M f (no-changeset !)
2432 2431 b (no-filelog no-changeset !)
2433 2432 R b
2434 2433 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEAm-0")'
2435 2434 M f (no-changeset !)
2436 2435 b (no-filelog no-changeset !)
2437 2436 R b
2438 2437 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAEm-0")'
2439 2438 M f (no-changeset !)
2440 2439 d (no-filelog no-changeset !)
2441 2440 R d
2442 2441 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEAm-0")'
2443 2442 M f (no-changeset !)
2444 2443 d (no-filelog no-changeset !)
2445 2444 R d
2446 2445 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
2447 2446 A f
2448 2447 d
2449 2448 R d
2450 2449 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
2451 2450 A f
2452 2451 b
2453 2452 R b
2454 2453
2455 2454 # From here, we run status against revision where both source file exists.
2456 2455 #
2457 2456 # The filelog based implementation picks an arbitrary side based on revision
2458 2457 # numbers. So the same side "wins" whatever the parents order is. This is
2459 2458 # sub-optimal because depending on revision numbers means the result can be
2460 2459 # different from one repository to the next.
2461 2460 #
2462 2461 # The changeset based algorithm use the parent order to break tie on conflicting
2463 2462 # information and will have a different order depending on who is p1 and p2.
2464 2463 # That order is stable accross repositories. (data from p1 prevails)
2465 2464
2466 2465 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAEm-0")'
2467 2466 A f
2468 2467 d
2469 2468 R b
2470 2469 R d
2471 2470 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEAm-0")'
2472 2471 A f
2473 2472 d (filelog !)
2474 2473 b (no-filelog !)
2475 2474 R b
2476 2475 R d
2477 2476 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm-0")'
2478 2477 A f
2479 2478 a
2480 2479 A t
2481 2480 p
2482 2481 R a
2483 2482 R b
2484 2483 R p
2485 2484 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm-0")'
2486 2485 A f
2487 2486 a (filelog !)
2488 2487 b (no-filelog !)
2489 2488 A t
2490 2489 p
2491 2490 R a
2492 2491 R b
2493 2492 R p
2494 2493
2495 2494
2496 2495 Subcase: existing copy information overwritten on one branch
2497 2496 ````````````````````````````````````````````````````````````
2498 2497
2499 2498 Note:
2500 2499 | In this case, one of the merge wrongly record a merge while there is none.
2501 2500 | This lead to bad copy tracing information to be dug up.
2502 2501
2503 2502
2504 2503 Merge:
2505 2504 - one with change to an unrelated file (b)
2506 2505 - one overwriting a file (d) with a rename (from h to i to d)
2507 2506
2508 2507 $ hg log -G --rev '::(desc("mBFm")+desc("mFBm"))'
2509 2508 o mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
2510 2509 |\
2511 2510 +---o mBFm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
2512 2511 | |/
2513 2512 | o f-2: rename i -> d
2514 2513 | |
2515 2514 | o f-1: rename h -> i
2516 2515 | |
2517 2516 o | b-1: b update
2518 2517 |/
2519 2518 o i-2: c -move-> d, s -move-> t
2520 2519 |
2521 2520 o i-1: a -move-> c, p -move-> s
2522 2521 |
2523 2522 o i-0 initial commit: a b h p q r
2524 2523
2525 2524 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBFm-0")'
2526 2525 M b
2527 2526 A d
2528 2527 h
2529 2528 A t
2530 2529 p
2531 2530 R a
2532 2531 R h
2533 2532 R p
2534 2533 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFBm-0")'
2535 2534 M b
2536 2535 A d
2537 2536 h
2538 2537 A t
2539 2538 p
2540 2539 R a
2541 2540 R h
2542 2541 R p
2543 2542 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBFm-0")'
2544 2543 M d (no-changeset !)
2545 2544 h (no-filelog no-changeset !)
2546 2545 R h
2547 2546 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBFm-0")'
2548 2547 M b
2549 2548 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBFm-0")'
2550 2549 M b
2551 2550 M d (no-changeset !)
2552 2551 i (no-filelog no-changeset !)
2553 2552 R i
2554 2553 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFBm-0")'
2555 2554 M d (no-changeset !)
2556 2555 h (no-filelog no-changeset !)
2557 2556 R h
2558 2557 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFBm-0")'
2559 2558 M b
2560 2559 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFBm-0")'
2561 2560 M b
2562 2561 M d (no-changeset !)
2563 2562 i (no-filelog no-changeset !)
2564 2563 R i
2565 2564
2566 2565 #if no-changeset
2567 2566 $ hg log -Gfr 'desc("mBFm-0")' d
2568 2567 o f-2: rename i -> d
2569 2568 |
2570 2569 o f-1: rename h -> i
2571 2570 :
2572 2571 o i-0 initial commit: a b h p q r
2573 2572
2574 2573 #else
2575 2574 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2576 2575 $ hg log -Gfr 'desc("mBFm-0")' d
2577 2576 o i-2: c -move-> d, s -move-> t
2578 2577 |
2579 2578 ~
2580 2579 #endif
2581 2580
2582 2581 #if no-changeset
2583 2582 $ hg log -Gfr 'desc("mFBm-0")' d
2584 2583 o f-2: rename i -> d
2585 2584 |
2586 2585 o f-1: rename h -> i
2587 2586 :
2588 2587 o i-0 initial commit: a b h p q r
2589 2588
2590 2589 #else
2591 2590 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2592 2591 $ hg log -Gfr 'desc("mFBm-0")' d
2593 2592 o i-2: c -move-> d, s -move-> t
2594 2593 |
2595 2594 ~
2596 2595 #endif
2597 2596
2598 2597
2599 2598 Subcase: existing copy information overwritten on one branch, with different content)
2600 2599 `````````````````````````````````````````````````````````````````````````````````````
2601 2600
2602 2601 Merge:
2603 2602 - one with change to an unrelated file (b)
2604 2603 - one overwriting a file (t) with a rename (from r to x to t), v content is not the same as on the other branch
2605 2604
2606 2605 $ hg log -G --rev '::(desc("mBRm")+desc("mRBm"))'
2607 2606 o mRBm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - the other way
2608 2607 |\
2609 2608 +---o mBRm-0 simple merge - B side: unrelated change, R side: overwrite d with a copy (from r->x->t) different content - one way
2610 2609 | |/
2611 2610 | o r-2: rename t -> x
2612 2611 | |
2613 2612 | o r-1: rename r -> x
2614 2613 | |
2615 2614 o | b-1: b update
2616 2615 |/
2617 2616 o i-2: c -move-> d, s -move-> t
2618 2617 |
2619 2618 o i-1: a -move-> c, p -move-> s
2620 2619 |
2621 2620 o i-0 initial commit: a b h p q r
2622 2621
2623 2622 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBRm-0")'
2624 2623 M b
2625 2624 A d
2626 2625 a
2627 2626 A t
2628 2627 r
2629 2628 R a
2630 2629 R p
2631 2630 R r
2632 2631 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mRBm-0")'
2633 2632 M b
2634 2633 A d
2635 2634 a
2636 2635 A t
2637 2636 r
2638 2637 R a
2639 2638 R p
2640 2639 R r
2641 2640 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBRm-0")'
2642 2641 M t
2643 2642 r (no-filelog !)
2644 2643 R r
2645 2644 $ hg status --copies --rev 'desc("r-2")' --rev 'desc("mBRm-0")'
2646 2645 M b
2647 2646 $ hg status --copies --rev 'desc("r-1")' --rev 'desc("mBRm-0")'
2648 2647 M b
2649 2648 M t
2650 2649 x (no-filelog !)
2651 2650 R x
2652 2651 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mRBm-0")'
2653 2652 M t
2654 2653 r (no-filelog !)
2655 2654 R r
2656 2655 $ hg status --copies --rev 'desc("r-2")' --rev 'desc("mRBm-0")'
2657 2656 M b
2658 2657 $ hg status --copies --rev 'desc("r-1")' --rev 'desc("mRBm-0")'
2659 2658 M b
2660 2659 M t
2661 2660 x (no-filelog !)
2662 2661 R x
2663 2662
2664 2663 #if no-changeset
2665 2664 $ hg log -Gfr 'desc("mBRm-0")' d
2666 2665 o i-2: c -move-> d, s -move-> t
2667 2666 |
2668 2667 o i-1: a -move-> c, p -move-> s
2669 2668 |
2670 2669 o i-0 initial commit: a b h p q r
2671 2670
2672 2671 #else
2673 2672 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2674 2673 $ hg log -Gfr 'desc("mBRm-0")' d
2675 2674 o i-2: c -move-> d, s -move-> t
2676 2675 |
2677 2676 ~
2678 2677 #endif
2679 2678
2680 2679 #if no-changeset
2681 2680 $ hg log -Gfr 'desc("mRBm-0")' d
2682 2681 o i-2: c -move-> d, s -move-> t
2683 2682 |
2684 2683 o i-1: a -move-> c, p -move-> s
2685 2684 |
2686 2685 o i-0 initial commit: a b h p q r
2687 2686
2688 2687 #else
2689 2688 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2690 2689 $ hg log -Gfr 'desc("mRBm-0")' d
2691 2690 o i-2: c -move-> d, s -move-> t
2692 2691 |
2693 2692 ~
2694 2693 #endif
2695 2694
2696 2695 Subcase: reset of the copy history on one side
2697 2696 ``````````````````````````````````````````````
2698 2697
2699 2698 Merge:
2700 2699 - one with change to a file
2701 2700 - one deleting and recreating the file
2702 2701
2703 2702 Unlike in the 'BD/DB' cases, an actual merge happened here. So we should
2704 2703 consider history and rename on both branch of the merge.
2705 2704
2706 2705 $ hg log -G --rev '::(desc("mDGm")+desc("mGDm"))'
2707 2706 o mGDm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - the other way
2708 2707 |\
2709 2708 +---o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2710 2709 | |/
2711 2710 | o g-1: update d
2712 2711 | |
2713 2712 o | d-2 re-add d
2714 2713 | |
2715 2714 o | d-1 delete d
2716 2715 |/
2717 2716 o i-2: c -move-> d, s -move-> t
2718 2717 |
2719 2718 o i-1: a -move-> c, p -move-> s
2720 2719 |
2721 2720 o i-0 initial commit: a b h p q r
2722 2721
2723 2722 One side of the merge have a long history with rename. The other side of the
2724 2723 merge point to a new file with a smaller history. Each side is "valid".
2725 2724
2726 2725 (and again the filelog based algorithm only explore one, with a pick based on
2727 2726 revision numbers)
2728 2727
2729 2728 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mDGm-0")'
2730 2729 A d
2731 2730 a (filelog !)
2732 2731 A t
2733 2732 p
2734 2733 R a
2735 2734 R p
2736 2735 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGDm-0")'
2737 2736 A d
2738 2737 a
2739 2738 A t
2740 2739 p
2741 2740 R a
2742 2741 R p
2743 2742 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mDGm-0")'
2744 2743 M d
2745 2744 $ hg status --copies --rev 'desc("d-2")' --rev 'desc("mGDm-0")'
2746 2745 M d
2747 2746 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mDGm-0")'
2748 2747 M d
2749 2748 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGDm-0")'
2750 2749 M d
2751 2750
2752 2751 #if no-changeset
2753 2752 $ hg log -Gfr 'desc("mDGm-0")' d
2754 2753 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2755 2754 |\
2756 2755 | o g-1: update d
2757 2756 | |
2758 2757 o | d-2 re-add d
2759 2758 |/
2760 2759 o i-2: c -move-> d, s -move-> t
2761 2760 |
2762 2761 o i-1: a -move-> c, p -move-> s
2763 2762 |
2764 2763 o i-0 initial commit: a b h p q r
2765 2764
2766 2765 #else
2767 2766 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2768 2767 $ hg log -Gfr 'desc("mDGm-0")' d
2769 2768 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2770 2769 |\
2771 2770 | o g-1: update d
2772 2771 | |
2773 2772 o | d-2 re-add d
2774 2773 |/
2775 2774 o i-2: c -move-> d, s -move-> t
2776 2775 |
2777 2776 ~
2778 2777 #endif
2779 2778
2780 2779
2781 2780 #if no-changeset
2782 2781 $ hg log -Gfr 'desc("mDGm-0")' d
2783 2782 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2784 2783 |\
2785 2784 | o g-1: update d
2786 2785 | |
2787 2786 o | d-2 re-add d
2788 2787 |/
2789 2788 o i-2: c -move-> d, s -move-> t
2790 2789 |
2791 2790 o i-1: a -move-> c, p -move-> s
2792 2791 |
2793 2792 o i-0 initial commit: a b h p q r
2794 2793
2795 2794 #else
2796 2795 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2797 2796 $ hg log -Gfr 'desc("mDGm-0")' d
2798 2797 o mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way
2799 2798 |\
2800 2799 | o g-1: update d
2801 2800 | |
2802 2801 o | d-2 re-add d
2803 2802 |/
2804 2803 o i-2: c -move-> d, s -move-> t
2805 2804 |
2806 2805 ~
2807 2806 #endif
2808 2807
2809 2808 Subcase: merging a change to a file with a "copy overwrite" to that file from another branch
2810 2809 ````````````````````````````````````````````````````````````````````````````````````````````
2811 2810
2812 2811 Merge:
2813 2812 - one with change to a file (d)
2814 2813 - one overwriting that file with a rename (from h to i, to d)
2815 2814
2816 2815 This case is similar to BF/FB, but an actual merge happens, so both side of the
2817 2816 history are relevant.
2818 2817
2819 2818
2820 2819 $ hg log -G --rev '::(desc("mGFm")+desc("mFGm"))'
2821 2820 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2822 2821 |\
2823 2822 +---o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2824 2823 | |/
2825 2824 | o g-1: update d
2826 2825 | |
2827 2826 o | f-2: rename i -> d
2828 2827 | |
2829 2828 o | f-1: rename h -> i
2830 2829 |/
2831 2830 o i-2: c -move-> d, s -move-> t
2832 2831 |
2833 2832 o i-1: a -move-> c, p -move-> s
2834 2833 |
2835 2834 o i-0 initial commit: a b h p q r
2836 2835
2837 2836
2838 2837 Note:
2839 2838 | In this case, the merge get conflicting information since on one side we have
2840 2839 | "a -> c -> d". and one the other one we have "h -> i -> d".
2841 2840 |
2842 2841 | The current code arbitrarily pick one side depending the ordering of the merged hash:
2843 2842
2844 2843 In this case, the file hash from "f-2" is lower, so it will be `p1` of the resulting filenode its copy tracing information will win (and trace back to "h"):
2845 2844
2846 2845 Details on this hash ordering pick:
2847 2846
2848 2847 $ hg manifest --debug 'desc("g-1")' | egrep 'd$'
2849 2848 17ec97e605773eb44a117d1136b3849bcdc1924f 644 d (no-changeset !)
2850 2849 5cce88bf349f7c742bb440f2c53f81db9c294279 644 d (changeset !)
2851 2850 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("g-1")' d
2852 2851 A d
2853 2852 a (no-changeset no-compatibility !)
2854 2853
2855 2854 $ hg manifest --debug 'desc("f-2")' | egrep 'd$'
2856 2855 7b79e2fe0c8924e0e598a82f048a7b024afa4d96 644 d (no-changeset !)
2857 2856 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 d (changeset !)
2858 2857 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("f-2")' d
2859 2858 A d
2860 2859 h (no-changeset no-compatibility !)
2861 2860
2862 2861 Copy tracing data on the resulting merge:
2863 2862
2864 2863 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm-0")'
2865 2864 A d
2866 2865 h (no-filelog !)
2867 2866 a (filelog !)
2868 2867 A t
2869 2868 p
2870 2869 R a
2871 2870 R h
2872 2871 R p
2873 2872 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm-0")'
2874 2873 A d
2875 2874 a (no-changeset !)
2876 2875 h (changeset !)
2877 2876 A t
2878 2877 p
2879 2878 R a
2880 2879 R h
2881 2880 R p
2882 2881 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFGm-0")'
2883 2882 M d
2884 2883 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mGFm-0")'
2885 2884 M d
2886 2885 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFGm-0")'
2887 2886 M d
2888 2887 i (no-filelog !)
2889 2888 R i
2890 2889 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mGFm-0")'
2891 2890 M d
2892 2891 i (no-filelog !)
2893 2892 R i
2894 2893 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mFGm-0")'
2895 2894 M d (no-changeset !)
2896 2895 h (no-filelog no-changeset !)
2897 2896 R h
2898 2897 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGFm-0")'
2899 2898 M d (no-changeset !)
2900 2899 h (no-filelog no-changeset !)
2901 2900 R h
2902 2901
2903 2902 #if no-changeset
2904 2903 $ hg log -Gfr 'desc("mFGm-0")' d
2905 2904 o mFGm-0 merge - G side: content change, F side: copy overwrite, no content change - one way
2906 2905 |\
2907 2906 | o g-1: update d
2908 2907 | |
2909 2908 o | f-2: rename i -> d
2910 2909 | |
2911 2910 o | f-1: rename h -> i
2912 2911 |/
2913 2912 o i-2: c -move-> d, s -move-> t
2914 2913 |
2915 2914 o i-1: a -move-> c, p -move-> s
2916 2915 |
2917 2916 o i-0 initial commit: a b h p q r
2918 2917
2919 2918 #else
2920 2919 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2921 2920 $ hg log -Gfr 'desc("mFGm-0")' d
2922 2921 o g-1: update d
2923 2922 |
2924 2923 o i-2: c -move-> d, s -move-> t
2925 2924 |
2926 2925 ~
2927 2926 #endif
2928 2927
2929 2928 #if no-changeset
2930 2929 $ hg log -Gfr 'desc("mGFm-0")' d
2931 2930 o mGFm-0 merge - G side: content change, F side: copy overwrite, no content change - the other way
2932 2931 |\
2933 2932 | o g-1: update d
2934 2933 | |
2935 2934 o | f-2: rename i -> d
2936 2935 | |
2937 2936 o | f-1: rename h -> i
2938 2937 |/
2939 2938 o i-2: c -move-> d, s -move-> t
2940 2939 |
2941 2940 o i-1: a -move-> c, p -move-> s
2942 2941 |
2943 2942 o i-0 initial commit: a b h p q r
2944 2943
2945 2944 #else
2946 2945 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
2947 2946 $ hg log -Gfr 'desc("mGFm-0")' d
2948 2947 o g-1: update d
2949 2948 |
2950 2949 o i-2: c -move-> d, s -move-> t
2951 2950 |
2952 2951 ~
2953 2952 #endif
2954 2953
2955 2954 Subcase: new copy information on both side with an actual merge happening
2956 2955 `````````````````````````````````````````````````````````````````````````
2957 2956
2958 2957 - the "p-" branch renaming 't' to 'v' (through 'u')
2959 2958 - the "q-" branch renaming 'r' to 'v' (through 'w')
2960 2959
2961 2960
2962 2961 $ hg log -G --rev '::(desc("mPQm")+desc("mQPm"))'
2963 2962 o mQPm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - the other way
2964 2963 |\
2965 2964 +---o mPQm-0 merge with copies info on both side - P side: rename t to v, Q side: r to v, (different content) - one way
2966 2965 | |/
2967 2966 | o q-2 w -move-> v
2968 2967 | |
2969 2968 | o q-1 r -move-> w
2970 2969 | |
2971 2970 o | p-2: u -move-> v
2972 2971 | |
2973 2972 o | p-1: t -move-> u
2974 2973 |/
2975 2974 o i-2: c -move-> d, s -move-> t
2976 2975 |
2977 2976 o i-1: a -move-> c, p -move-> s
2978 2977 |
2979 2978 o i-0 initial commit: a b h p q r
2980 2979
2981 2980
2982 2981 #if no-changeset
2983 2982 $ hg manifest --debug --rev 'desc("mPQm-0")' | grep '644 v'
2984 2983 0946c662ef16e4e67397fd717389eb6693d41749 644 v
2985 2984 $ hg manifest --debug --rev 'desc("mQPm-0")' | grep '644 v'
2986 2985 0db3aad7fcc1ec27fab57060e327b9e864ea0cc9 644 v
2987 2986 $ hg manifest --debug --rev 'desc("p-2")' | grep '644 v'
2988 2987 3f91841cd75cadc9a1f1b4e7c1aa6d411f76032e 644 v
2989 2988 $ hg manifest --debug --rev 'desc("q-2")' | grep '644 v'
2990 2989 c43c088b811fd27983c0a9aadf44f3343cd4cd7e 644 v
2991 $ hg debugindex v | ../no-linkrev
2990 $ hg debugindex v | "$PYTHON" ../no-linkrev
2992 2991 rev linkrev nodeid p1 p2
2993 2992 0 * 3f91841cd75c 000000000000 000000000000
2994 2993 1 * c43c088b811f 000000000000 000000000000
2995 2994 2 * 0946c662ef16 3f91841cd75c c43c088b811f
2996 2995 3 * 0db3aad7fcc1 c43c088b811f 3f91841cd75c
2997 2996 #else
2998 2997 $ hg manifest --debug --rev 'desc("mPQm-0")' | grep '644 v'
2999 2998 65fde9f6e4d4da23b3f610e07b53673ea9541d75 644 v
3000 2999 $ hg manifest --debug --rev 'desc("mQPm-0")' | grep '644 v'
3001 3000 a098dda6413aecf154eefc976afc38b295acb7e5 644 v
3002 3001 $ hg manifest --debug --rev 'desc("p-2")' | grep '644 v'
3003 3002 5aed6a8dbff0301328c08360d24354d3d064cf0d 644 v
3004 3003 $ hg manifest --debug --rev 'desc("q-2")' | grep '644 v'
3005 3004 a38b2fa170219750dac9bc7d19df831f213ba708 644 v
3006 $ hg debugindex v | ../no-linkrev
3005 $ hg debugindex v | "$PYTHON" ../no-linkrev
3007 3006 rev linkrev nodeid p1 p2
3008 3007 0 * 5aed6a8dbff0 000000000000 000000000000
3009 3008 1 * a38b2fa17021 000000000000 000000000000
3010 3009 2 * 65fde9f6e4d4 5aed6a8dbff0 a38b2fa17021
3011 3010 3 * a098dda6413a a38b2fa17021 5aed6a8dbff0
3012 3011 #endif
3013 3012
3014 3013 # Here the filelog based implementation is not looking at the rename
3015 3014 # information (because the file exist on both side). However the changelog
3016 3015 # based on works fine. We have different output.
3017 3016
3018 3017 $ hg status --copies --rev 'desc("p-2")' --rev 'desc("mPQm-0")'
3019 3018 M v
3020 3019 r (no-filelog !)
3021 3020 R r
3022 3021 $ hg status --copies --rev 'desc("p-2")' --rev 'desc("mQPm-0")'
3023 3022 M v
3024 3023 r (no-filelog !)
3025 3024 R r
3026 3025 $ hg status --copies --rev 'desc("q-2")' --rev 'desc("mPQm-0")'
3027 3026 M v
3028 3027 t (no-filelog !)
3029 3028 R t
3030 3029 $ hg status --copies --rev 'desc("q-2")' --rev 'desc("mQPm-0")'
3031 3030 M v
3032 3031 t (no-filelog !)
3033 3032 R t
3034 3033 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("p-2")'
3035 3034 A v
3036 3035 t
3037 3036 R t
3038 3037 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("q-2")'
3039 3038 A v
3040 3039 r
3041 3040 R r
3042 3041
3043 3042 # From here, we run status against revision where both source file exists.
3044 3043 #
3045 3044 # The filelog based implementation picks an arbitrary side based on revision
3046 3045 # numbers. So the same side "wins" whatever the parents order is. This is
3047 3046 # sub-optimal because depending on revision numbers means the result can be
3048 3047 # different from one repository to the next.
3049 3048 #
3050 3049 # The changeset based algorithm use the parent order to break tie on conflicting
3051 3050 # information and will have a different order depending on who is p1 and p2.
3052 3051 # That order is stable accross repositories. (data from p1 prevails)
3053 3052
3054 3053 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mPQm-0")'
3055 3054 A v
3056 3055 t
3057 3056 R r
3058 3057 R t
3059 3058 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mQPm-0")'
3060 3059 A v
3061 3060 t (filelog !)
3062 3061 r (no-filelog !)
3063 3062 R r
3064 3063 R t
3065 3064 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mPQm-0")'
3066 3065 A d
3067 3066 a
3068 3067 A v
3069 3068 r (filelog !)
3070 3069 p (no-filelog !)
3071 3070 R a
3072 3071 R p
3073 3072 R r
3074 3073 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mQPm-0")'
3075 3074 A d
3076 3075 a
3077 3076 A v
3078 3077 r
3079 3078 R a
3080 3079 R p
3081 3080 R r
3082 3081
3083 3082
3084 3083 Comparing with merging with a deletion (and keeping the file)
3085 3084 -------------------------------------------------------------
3086 3085
3087 3086 Merge:
3088 3087 - one removing a file (d)
3089 3088 - one updating that file
3090 3089 - the merge keep the modified version of the file (canceling the delete)
3091 3090
3092 3091 In this case, the file keep on living after the merge. So we should not drop its
3093 3092 copy tracing chain.
3094 3093
3095 3094 $ hg log -G --rev '::(desc("mCGm")+desc("mGCm"))'
3096 3095 o mGCm-0 merge updated/deleted - revive the file (updated content) - the other way
3097 3096 |\
3098 3097 +---o mCGm-0 merge updated/deleted - revive the file (updated content) - one way
3099 3098 | |/
3100 3099 | o g-1: update d
3101 3100 | |
3102 3101 o | c-1 delete d
3103 3102 |/
3104 3103 o i-2: c -move-> d, s -move-> t
3105 3104 |
3106 3105 o i-1: a -move-> c, p -move-> s
3107 3106 |
3108 3107 o i-0 initial commit: a b h p q r
3109 3108
3110 3109
3111 3110 'a' is the copy source of 'd'
3112 3111
3113 3112 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCGm-0")'
3114 3113 A d
3115 3114 a (no-compatibility no-changeset !)
3116 3115 A t
3117 3116 p
3118 3117 R a
3119 3118 R p
3120 3119 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGCm-0")'
3121 3120 A d
3122 3121 a (no-compatibility no-changeset !)
3123 3122 A t
3124 3123 p
3125 3124 R a
3126 3125 R p
3127 3126 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCGm-0")'
3128 3127 A d
3129 3128 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mGCm-0")'
3130 3129 A d
3131 3130 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mCGm-0")'
3132 3131 $ hg status --copies --rev 'desc("g-1")' --rev 'desc("mGCm-0")'
3133 3132
3134 3133
3135 3134 Comparing with merge restoring an untouched deleted file
3136 3135 --------------------------------------------------------
3137 3136
3138 3137 Merge:
3139 3138 - one removing a file (d)
3140 3139 - one leaving the file untouched
3141 3140 - the merge actively restore the file to the same content.
3142 3141
3143 3142 In this case, the file keep on living after the merge. So we should not drop its
3144 3143 copy tracing chain.
3145 3144
3146 3145 $ hg log -G --rev '::(desc("mCB-revert-m")+desc("mBC-revert-m"))'
3147 3146 o mBC-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
3148 3147 |\
3149 3148 +---o mCB-revert-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
3150 3149 | |/
3151 3150 | o c-1 delete d
3152 3151 | |
3153 3152 o | b-1: b update
3154 3153 |/
3155 3154 o i-2: c -move-> d, s -move-> t
3156 3155 |
3157 3156 o i-1: a -move-> c, p -move-> s
3158 3157 |
3159 3158 o i-0 initial commit: a b h p q r
3160 3159
3161 3160
3162 3161 'a' is the the copy source of 'd'
3163 3162
3164 3163 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
3165 3164 M b
3166 3165 A d
3167 3166 a (no-compatibility no-changeset !)
3168 3167 A t
3169 3168 p
3170 3169 R a
3171 3170 R p
3172 3171 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
3173 3172 M b
3174 3173 A d
3175 3174 a (no-compatibility no-changeset !)
3176 3175 A t
3177 3176 p
3178 3177 R a
3179 3178 R p
3180 3179 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-revert-m-0")'
3181 3180 M b
3182 3181 A d
3183 3182 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-revert-m-0")'
3184 3183 M b
3185 3184 A d
3186 3185 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-revert-m-0")'
3187 3186 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-revert-m-0")'
3188 3187
3189 3188
3190 3189 Merging a branch where a rename was deleted with a branch where the same file was renamed
3191 3190 ------------------------------------------------------------------------------------------
3192 3191
3193 3192 Create a "conflicting" merge where `d` get removed on one branch before its
3194 3193 rename information actually conflict with the other branch.
3195 3194
3196 3195 (the copy information from the branch that was not deleted should win).
3197 3196
3198 3197 $ hg log -G --rev '::(desc("mCH-delete-before-conflict-m")+desc("mHC-delete-before-conflict-m"))'
3199 3198 o mHC-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - the other way
3200 3199 |\
3201 3200 +---o mCH-delete-before-conflict-m-0 simple merge - C side: d is the results of renames then deleted, H side: d is result of another rename (same content as the other branch) - one way
3202 3201 | |/
3203 3202 | o h-1: b -(move)-> d
3204 3203 | |
3205 3204 o | c-1 delete d
3206 3205 | |
3207 3206 o | i-2: c -move-> d, s -move-> t
3208 3207 | |
3209 3208 o | i-1: a -move-> c, p -move-> s
3210 3209 |/
3211 3210 o i-0 initial commit: a b h p q r
3212 3211
3213 3212
3214 3213 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCH-delete-before-conflict-m")'
3215 3214 A d
3216 3215 b (no-compatibility no-changeset !)
3217 3216 A t
3218 3217 p
3219 3218 R a
3220 3219 R b
3221 3220 R p
3222 3221 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mHC-delete-before-conflict-m")'
3223 3222 A d
3224 3223 b
3225 3224 A t
3226 3225 p
3227 3226 R a
3228 3227 R b
3229 3228 R p
3230 3229 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCH-delete-before-conflict-m")'
3231 3230 A d
3232 3231 b
3233 3232 R b
3234 3233 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mHC-delete-before-conflict-m")'
3235 3234 A d
3236 3235 b
3237 3236 R b
3238 3237 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mCH-delete-before-conflict-m")'
3239 3238 A t
3240 3239 p
3241 3240 R a
3242 3241 R p
3243 3242 $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")'
3244 3243 A t
3245 3244 p
3246 3245 R a
3247 3246 R p
3248 3247
3249 3248 Variant of previous with extra changes introduced by the merge
3250 3249 --------------------------------------------------------------
3251 3250
3252 3251 (see case declaration for details)
3253 3252
3254 3253 Subcase: merge has same initial content on both side, but merge introduced a change
3255 3254 ```````````````````````````````````````````````````````````````````````````````````
3256 3255
3257 3256 - the "e-" branch renaming b to f (through 'g')
3258 3257 - the "a-" branch renaming d to f (through e)
3259 3258 - the merge add new change to b
3260 3259
3261 3260 $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))'
3262 3261 o mEA-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - the other way
3263 3262 |\
3264 3263 +---o mAE-change-m-0 merge with file update and copies info on both side - A side: rename d to f, E side: b to f, (same content for f in parent) - one way
3265 3264 | |/
3266 3265 | o e-2 g -move-> f
3267 3266 | |
3268 3267 | o e-1 b -move-> g
3269 3268 | |
3270 3269 o | a-2: e -move-> f
3271 3270 | |
3272 3271 o | a-1: d -move-> e
3273 3272 |/
3274 3273 o i-2: c -move-> d, s -move-> t
3275 3274 |
3276 3275 o i-1: a -move-> c, p -move-> s
3277 3276 |
3278 3277 o i-0 initial commit: a b h p q r
3279 3278
3280 3279 #if no-changeset
3281 3280 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
3282 3281 2f649fba7eb284e720d02b61f0546fcef694c045 644 f
3283 3282 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
3284 3283 774e7c1637d536b99e2d8ef16fd731f87a82bd09 644 f
3285 3284 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
3286 3285 b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f
3287 3286 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
3288 3287 e8825b386367b29fec957283a80bb47b47483fe1 644 f
3289 $ hg debugindex f | ../no-linkrev
3288 $ hg debugindex f | "$PYTHON" ../no-linkrev
3290 3289 rev linkrev nodeid p1 p2
3291 3290 0 * b76eb76580df 000000000000 000000000000
3292 3291 1 * e8825b386367 000000000000 000000000000
3293 3292 2 * 2ff93c643948 b76eb76580df e8825b386367
3294 3293 3 * 2f649fba7eb2 b76eb76580df e8825b386367
3295 3294 4 * 774e7c1637d5 e8825b386367 b76eb76580df
3296 3295 #else
3297 3296 $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f'
3298 3297 d3613c1ec8310a812ac4268fd853ac576b6caea5 644 f
3299 3298 $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f'
3300 3299 05e03c868bbcab4a649cb33a238d7aa07398a469 644 f
3301 3300 $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f'
3302 3301 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
3303 3302 $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f'
3304 3303 ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f
3305 $ hg debugindex f | ../no-linkrev
3304 $ hg debugindex f | "$PYTHON" ../no-linkrev
3306 3305 rev linkrev nodeid p1 p2
3307 3306 0 * ae258f702dfe 000000000000 000000000000
3308 3307 1 * d3613c1ec831 ae258f702dfe 000000000000
3309 3308 2 * 05e03c868bbc ae258f702dfe 000000000000
3310 3309 #endif
3311 3310
3312 3311 # Here the filelog based implementation is not looking at the rename
3313 3312 # information (because the file exist on both side). However the changelog
3314 3313 # based on works fine. We have different output.
3315 3314
3316 3315 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAE-change-m-0")'
3317 3316 M f
3318 3317 b (no-filelog !)
3319 3318 R b
3320 3319 $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEA-change-m-0")'
3321 3320 M f
3322 3321 b (no-filelog !)
3323 3322 R b
3324 3323 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAE-change-m-0")'
3325 3324 M f
3326 3325 d (no-filelog !)
3327 3326 R d
3328 3327 $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEA-change-m-0")'
3329 3328 M f
3330 3329 d (no-filelog !)
3331 3330 R d
3332 3331 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")'
3333 3332 A f
3334 3333 d
3335 3334 R d
3336 3335 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")'
3337 3336 A f
3338 3337 b
3339 3338 R b
3340 3339
3341 3340 # From here, we run status against revision where both source file exists.
3342 3341 #
3343 3342 # The filelog based implementation picks an arbitrary side based on revision
3344 3343 # numbers. So the same side "wins" whatever the parents order is. This is
3345 3344 # sub-optimal because depending on revision numbers means the result can be
3346 3345 # different from one repository to the next.
3347 3346 #
3348 3347 # The changeset based algorithm use the parent order to break tie on conflicting
3349 3348 # information and will have a different order depending on who is p1 and p2.
3350 3349 # That order is stable accross repositories. (data from p1 prevails)
3351 3350
3352 3351 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAE-change-m-0")'
3353 3352 A f
3354 3353 d
3355 3354 R b
3356 3355 R d
3357 3356 $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEA-change-m-0")'
3358 3357 A f
3359 3358 d (filelog !)
3360 3359 b (no-filelog !)
3361 3360 R b
3362 3361 R d
3363 3362 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m-0")'
3364 3363 A f
3365 3364 a
3366 3365 A t
3367 3366 p
3368 3367 R a
3369 3368 R b
3370 3369 R p
3371 3370 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m-0")'
3372 3371 A f
3373 3372 a (filelog !)
3374 3373 b (no-filelog !)
3375 3374 A t
3376 3375 p
3377 3376 R a
3378 3377 R b
3379 3378 R p
3380 3379
3381 3380
3382 3381 Subcase: merge overwrite common copy information, but with extra change during the merge
3383 3382 ```````````````````````````````````````````````````````````````````````````````````
3384 3383
3385 3384 Merge:
3386 3385 - one with change to an unrelated file (b)
3387 3386 - one overwriting a file (d) with a rename (from h to i to d)
3388 3387
3389 3388 $ hg log -G --rev '::(desc("mBF-change-m")+desc("mFB-change-m"))'
3390 3389 o mFB-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
3391 3390 |\
3392 3391 +---o mBF-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
3393 3392 | |/
3394 3393 | o f-2: rename i -> d
3395 3394 | |
3396 3395 | o f-1: rename h -> i
3397 3396 | |
3398 3397 o | b-1: b update
3399 3398 |/
3400 3399 o i-2: c -move-> d, s -move-> t
3401 3400 |
3402 3401 o i-1: a -move-> c, p -move-> s
3403 3402 |
3404 3403 o i-0 initial commit: a b h p q r
3405 3404
3406 3405 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBF-change-m-0")'
3407 3406 M b
3408 3407 A d
3409 3408 h (filelog !)
3410 3409 h (sidedata !)
3411 3410 h (upgraded !)
3412 3411 h (upgraded-parallel !)
3413 3412 h (changeset !)
3414 3413 h (compatibility !)
3415 3414 A t
3416 3415 p
3417 3416 R a
3418 3417 R h
3419 3418 R p
3420 3419 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFB-change-m-0")'
3421 3420 M b
3422 3421 A d
3423 3422 h
3424 3423 A t
3425 3424 p
3426 3425 R a
3427 3426 R h
3428 3427 R p
3429 3428 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBF-change-m-0")'
3430 3429 M d
3431 3430 h (no-filelog !)
3432 3431 R h
3433 3432 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mBF-change-m-0")'
3434 3433 M b
3435 3434 M d
3436 3435 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mBF-change-m-0")'
3437 3436 M b
3438 3437 M d
3439 3438 i (no-filelog !)
3440 3439 R i
3441 3440 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mFB-change-m-0")'
3442 3441 M d
3443 3442 h (no-filelog !)
3444 3443 R h
3445 3444 $ hg status --copies --rev 'desc("f-2")' --rev 'desc("mFB-change-m-0")'
3446 3445 M b
3447 3446 M d
3448 3447 $ hg status --copies --rev 'desc("f-1")' --rev 'desc("mFB-change-m-0")'
3449 3448 M b
3450 3449 M d
3451 3450 i (no-filelog !)
3452 3451 R i
3453 3452
3454 3453 #if no-changeset
3455 3454 $ hg log -Gfr 'desc("mBF-change-m-0")' d
3456 3455 o mBF-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
3457 3456 |\
3458 3457 o : f-2: rename i -> d
3459 3458 | :
3460 3459 o : f-1: rename h -> i
3461 3460 :/
3462 3461 o i-0 initial commit: a b h p q r
3463 3462
3464 3463 #else
3465 3464 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
3466 3465 $ hg log -Gfr 'desc("mBF-change-m-0")' d
3467 3466 o mBF-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - one way
3468 3467 :
3469 3468 o i-2: c -move-> d, s -move-> t
3470 3469 |
3471 3470 ~
3472 3471 #endif
3473 3472
3474 3473 #if no-changeset
3475 3474 $ hg log -Gfr 'desc("mFB-change-m-0")' d
3476 3475 o mFB-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
3477 3476 |\
3478 3477 o : f-2: rename i -> d
3479 3478 | :
3480 3479 o : f-1: rename h -> i
3481 3480 :/
3482 3481 o i-0 initial commit: a b h p q r
3483 3482
3484 3483 #else
3485 3484 BROKEN: `hg log --follow <file>` relies on filelog metadata to work
3486 3485 $ hg log -Gfr 'desc("mFB-change-m-0")' d
3487 3486 o mFB-change-m-0 merge with extra change - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way
3488 3487 :
3489 3488 o i-2: c -move-> d, s -move-> t
3490 3489 |
3491 3490 ~
3492 3491 #endif
3493 3492
3494 3493
3495 3494 Subcase: restoring and untouched deleted file, while touching it
3496 3495 ````````````````````````````````````````````````````````````````
3497 3496
3498 3497 Merge:
3499 3498 - one removing a file (d)
3500 3499 - one leaving the file untouched
3501 3500 - the merge actively restore the file to the same content.
3502 3501
3503 3502 In this case, the file keep on living after the merge. So we should not drop its
3504 3503 copy tracing chain.
3505 3504
3506 3505 $ hg log -G --rev '::(desc("mCB-change-m")+desc("mBC-change-m"))'
3507 3506 o mBC-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - the other way
3508 3507 |\
3509 3508 +---o mCB-change-m-0 merge explicitely revive deleted file - B side: unrelated change, C side: delete d (restored by merge) - one way
3510 3509 | |/
3511 3510 | o c-1 delete d
3512 3511 | |
3513 3512 o | b-1: b update
3514 3513 |/
3515 3514 o i-2: c -move-> d, s -move-> t
3516 3515 |
3517 3516 o i-1: a -move-> c, p -move-> s
3518 3517 |
3519 3518 o i-0 initial commit: a b h p q r
3520 3519
3521 3520
3522 3521 'a' is the the copy source of 'd'
3523 3522
3524 3523 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-change-m-0")'
3525 3524 M b
3526 3525 A d
3527 3526 a (no-compatibility no-changeset !)
3528 3527 A t
3529 3528 p
3530 3529 R a
3531 3530 R p
3532 3531 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-change-m-0")'
3533 3532 M b
3534 3533 A d
3535 3534 a (no-compatibility no-changeset !)
3536 3535 A t
3537 3536 p
3538 3537 R a
3539 3538 R p
3540 3539 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mCB-change-m-0")'
3541 3540 M b
3542 3541 A d
3543 3542 $ hg status --copies --rev 'desc("c-1")' --rev 'desc("mBC-change-m-0")'
3544 3543 M b
3545 3544 A d
3546 3545 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mCB-change-m-0")'
3547 3546 M d
3548 3547 $ hg status --copies --rev 'desc("b-1")' --rev 'desc("mBC-change-m-0")'
3549 3548 M d
3550 3549
3551 3550
3552 3551 Decision from previous merge are properly chained with later merge
3553 3552 ------------------------------------------------------------------
3554 3553
3555 3554
3556 3555 Subcase: chaining conflicting rename resolution
3557 3556 ```````````````````````````````````````````````
3558 3557
3559 3558 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
3560 3559 add more change on the respective branch and merge again. These second merge
3561 3560 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
3562 3561 about that file should stay unchanged.
3563 3562
3564 3563 The result from mAEm is the same for the subsequent merge:
3565 3564
3566 3565 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAEm")' f
3567 3566 A f
3568 3567 a (filelog !)
3569 3568 a (sidedata !)
3570 3569 a (upgraded !)
3571 3570 a (upgraded-parallel !)
3572 3571
3573 3572 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE,Km")' f
3574 3573 A f
3575 3574 a (filelog !)
3576 3575 a (sidedata !)
3577 3576 a (upgraded !)
3578 3577 a (upgraded-parallel !)
3579 3578
3580 3579 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AEm")' f
3581 3580 A f
3582 3581 a (filelog !)
3583 3582 a (sidedata !)
3584 3583 a (upgraded !)
3585 3584 a (upgraded-parallel !)
3586 3585
3587 3586
3588 3587 The result from mEAm is the same for the subsequent merge:
3589 3588
3590 3589 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEAm")' f
3591 3590 A f
3592 3591 a (filelog !)
3593 3592 b (sidedata !)
3594 3593 b (upgraded !)
3595 3594 b (upgraded-parallel !)
3596 3595
3597 3596 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA,Jm")' f
3598 3597 A f
3599 3598 a (filelog !)
3600 3599 b (sidedata !)
3601 3600 b (upgraded !)
3602 3601 b (upgraded-parallel !)
3603 3602
3604 3603 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EAm")' f
3605 3604 A f
3606 3605 a (filelog !)
3607 3606 b (sidedata !)
3608 3607 b (upgraded !)
3609 3608 b (upgraded-parallel !)
3610 3609
3611 3610 Subcase: chaining conflicting rename resolution
3612 3611 ```````````````````````````````````````````````
3613 3612
3614 3613 The "mPQm" and "mQPm" case create a rename tracking conflict on file 'v'. We
3615 3614 add more change on the respective branch and merge again. These second merge
3616 3615 does not involve the file 'v' and the arbitration done within "mPQm" and "mQP"
3617 3616 about that file should stay unchanged.
3618 3617
3619 3618 The result from mPQm is the same for the subsequent merge:
3620 3619
3621 3620 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mPQm")' v
3622 3621 A v
3623 3622 r (filelog !)
3624 3623 p (sidedata !)
3625 3624 p (upgraded !)
3626 3625 p (upgraded-parallel !)
3627 3626
3628 3627 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mPQ,Tm")' v
3629 3628 A v
3630 3629 r (filelog !)
3631 3630 p (sidedata !)
3632 3631 p (upgraded !)
3633 3632 p (upgraded-parallel !)
3634 3633
3635 3634 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mT,PQm")' v
3636 3635 A v
3637 3636 r (filelog !)
3638 3637 p (sidedata !)
3639 3638 p (upgraded !)
3640 3639 p (upgraded-parallel !)
3641 3640
3642 3641
3643 3642 The result from mQPm is the same for the subsequent merge:
3644 3643
3645 3644 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mQPm")' v
3646 3645 A v
3647 3646 r (no-changeset no-compatibility !)
3648 3647
3649 3648 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mQP,Sm")' v
3650 3649 A v
3651 3650 r (no-changeset no-compatibility !)
3652 3651
3653 3652 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mS,QPm")' v
3654 3653 A v
3655 3654 r (filelog !)
3656 3655 r (sidedata !)
3657 3656 r (upgraded !)
3658 3657 r (upgraded-parallel !)
3659 3658
3660 3659
3661 3660 Subcase: chaining salvage information during a merge
3662 3661 ````````````````````````````````````````````````````
3663 3662
3664 3663 We add more change on the branch were the file was deleted. merging again
3665 3664 should preserve the fact eh file was salvaged.
3666 3665
3667 3666 reference output:
3668 3667
3669 3668 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB-revert-m-0")'
3670 3669 M b
3671 3670 A d
3672 3671 a (no-changeset no-compatibility !)
3673 3672 A t
3674 3673 p
3675 3674 R a
3676 3675 R p
3677 3676 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC-revert-m-0")'
3678 3677 M b
3679 3678 A d
3680 3679 a (no-changeset no-compatibility !)
3681 3680 A t
3682 3681 p
3683 3682 R a
3684 3683 R p
3685 3684
3686 3685 chained output
3687 3686 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mBC+revert,Lm")'
3688 3687 M b
3689 3688 A d
3690 3689 a (no-changeset no-compatibility !)
3691 3690 A t
3692 3691 p
3693 3692 A unrelated-l
3694 3693 R a
3695 3694 R p
3696 3695 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mCB+revert,Lm")'
3697 3696 M b
3698 3697 A d
3699 3698 a (no-changeset no-compatibility !)
3700 3699 A t
3701 3700 p
3702 3701 A unrelated-l
3703 3702 R a
3704 3703 R p
3705 3704 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,BC+revertm")'
3706 3705 M b
3707 3706 A d
3708 3707 a (no-changeset no-compatibility !)
3709 3708 A t
3710 3709 p
3711 3710 A unrelated-l
3712 3711 R a
3713 3712 R p
3714 3713 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mL,CB+revertm")'
3715 3714 M b
3716 3715 A d
3717 3716 a (no-changeset no-compatibility !)
3718 3717 A t
3719 3718 p
3720 3719 A unrelated-l
3721 3720 R a
3722 3721 R p
3723 3722
3724 3723 Subcase: chaining "merged" information during a merge
3725 3724 ``````````````````````````````````````````````````````
3726 3725
3727 3726 When a non-rename change are merged with a copy overwrite, the merge pick the copy source from (p1) as the reference. We should preserve this information in subsequent merges.
3728 3727
3729 3728
3730 3729 reference output:
3731 3730
3732 3731 (for details about the filelog pick, check the mFGm/mGFm case)
3733 3732
3734 3733 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFGm")' d
3735 3734 A d
3736 3735 a (filelog !)
3737 3736 h (sidedata !)
3738 3737 h (upgraded !)
3739 3738 h (upgraded-parallel !)
3740 3739 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGFm")' d
3741 3740 A d
3742 3741 a (filelog !)
3743 3742 a (sidedata !)
3744 3743 a (upgraded !)
3745 3744 a (upgraded-parallel !)
3746 3745
3747 3746 Chained output
3748 3747
3749 3748 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mO,FGm")' d
3750 3749 A d
3751 3750 a (filelog !)
3752 3751 h (sidedata !)
3753 3752 h (upgraded !)
3754 3753 h (upgraded-parallel !)
3755 3754 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mFG,Om")' d
3756 3755 A d
3757 3756 a (filelog !)
3758 3757 h (sidedata !)
3759 3758 h (upgraded !)
3760 3759 h (upgraded-parallel !)
3761 3760
3762 3761
3763 3762 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mGF,Nm")' d
3764 3763 A d
3765 3764 a (no-changeset no-compatibility !)
3766 3765 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mN,GFm")' d
3767 3766 A d
3768 3767 a (no-changeset no-compatibility !)
3769 3768
3770 3769
3771 3770 Subcase: chaining conflicting rename resolution, with extra change during the merge
3772 3771 ```````````````````````````````````````````````````````````````````````````````````
3773 3772
3774 3773 The "mAEm" and "mEAm" case create a rename tracking conflict on file 'f'. We
3775 3774 add more change on the respective branch and merge again. These second merge
3776 3775 does not involve the file 'f' and the arbitration done within "mAEm" and "mEA"
3777 3776 about that file should stay unchanged.
3778 3777
3779 3778 The result from mAEm is the same for the subsequent merge:
3780 3779
3781 3780 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m")' f
3782 3781 A f
3783 3782 a (filelog !)
3784 3783 a (sidedata !)
3785 3784 a (upgraded !)
3786 3785 a (upgraded-parallel !)
3787 3786
3788 3787 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change,Km")' f
3789 3788 A f
3790 3789 a (filelog !)
3791 3790 a (sidedata !)
3792 3791 a (upgraded !)
3793 3792 a (upgraded-parallel !)
3794 3793
3795 3794 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mK,AE-change-m")' f
3796 3795 A f
3797 3796 a (no-changeset no-compatibility !)
3798 3797
3799 3798
3800 3799 The result from mEAm is the same for the subsequent merge:
3801 3800
3802 3801 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m")' f
3803 3802 A f
3804 3803 a (filelog !)
3805 3804 b (sidedata !)
3806 3805 b (upgraded !)
3807 3806 b (upgraded-parallel !)
3808 3807
3809 3808 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change,Jm")' f
3810 3809 A f
3811 3810 a (filelog !)
3812 3811 b (sidedata !)
3813 3812 b (upgraded !)
3814 3813 b (upgraded-parallel !)
3815 3814
3816 3815 $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mJ,EA-change-m")' f
3817 3816 A f
3818 3817 a (filelog !)
3819 3818 b (sidedata !)
3820 3819 b (upgraded !)
3821 3820 b (upgraded-parallel !)
General Comments 0
You need to be logged in to leave comments. Login now