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