Show More
@@ -687,6 +687,60 b' rename information actually conflict wit' | |||||
687 | o i-0 initial commit: a b h |
|
687 | o i-0 initial commit: a b h | |
688 |
|
688 | |||
689 |
|
689 | |||
|
690 | Variant of previous with extra changes introduced by the merge | |||
|
691 | -------------------------------------------------------------- | |||
|
692 | ||||
|
693 | 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. | |||
|
694 | ||||
|
695 | ||||
|
696 | Subcase: merge has same initial content on both side, but merge introduced a change | |||
|
697 | ``````````````````````````````````````````````````````````````````````````````````` | |||
|
698 | ||||
|
699 | Same as `mAEm` and `mEAm` but with extra change to the file before commiting | |||
|
700 | ||||
|
701 | - the "e-" branch renaming b to f (through 'g') | |||
|
702 | - the "a-" branch renaming d to f (through e) | |||
|
703 | ||||
|
704 | $ 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)" | |||
|
705 | ||||
|
706 | $ hg up 'desc("a-2")' | |||
|
707 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved | |||
|
708 | $ hg merge 'desc("e-2")' | |||
|
709 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !) | |||
|
710 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !) | |||
|
711 | (branch merge, don't forget to commit) | |||
|
712 | $ echo "content change for mAE-change-m" > f | |||
|
713 | $ hg ci -m "mAE-change-m-0 $case_desc - one way" | |||
|
714 | created new head | |||
|
715 | $ hg up 'desc("e-2")' | |||
|
716 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |||
|
717 | $ hg merge 'desc("a-2")' | |||
|
718 | 1 files updated, 0 files merged, 1 files removed, 0 files unresolved (no-changeset !) | |||
|
719 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved (changeset !) | |||
|
720 | (branch merge, don't forget to commit) | |||
|
721 | $ echo "content change for mEA-change-m" > f | |||
|
722 | $ hg ci -m "mEA-change-m-0 $case_desc - the other way" | |||
|
723 | created new head | |||
|
724 | $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))' | |||
|
725 | @ 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 | |||
|
726 | |\ | |||
|
727 | +---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 | |||
|
728 | | |/ | |||
|
729 | | o e-2 g -move-> f | |||
|
730 | | | | |||
|
731 | | o e-1 b -move-> g | |||
|
732 | | | | |||
|
733 | o | a-2: e -move-> f | |||
|
734 | | | | |||
|
735 | o | a-1: d -move-> e | |||
|
736 | |/ | |||
|
737 | o i-2: c -move-> d | |||
|
738 | | | |||
|
739 | o i-1: a -move-> c | |||
|
740 | | | |||
|
741 | o i-0 initial commit: a b h | |||
|
742 | ||||
|
743 | ||||
690 | Decision from previous merge are properly chained with later merge |
|
744 | Decision from previous merge are properly chained with later merge | |
691 | ------------------------------------------------------------------ |
|
745 | ------------------------------------------------------------------ | |
692 |
|
746 | |||
@@ -703,7 +757,7 b' about that file should stay unchanged.' | |||||
703 | (extra unrelated changes) |
|
757 | (extra unrelated changes) | |
704 |
|
758 | |||
705 | $ hg up 'desc("a-2")' |
|
759 | $ hg up 'desc("a-2")' | |
706 |
2 files updated, 0 files merged, |
|
760 | 2 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
707 | $ echo j > unrelated-j |
|
761 | $ echo j > unrelated-j | |
708 | $ hg add unrelated-j |
|
762 | $ hg add unrelated-j | |
709 | $ hg ci -m 'j-1: unrelated changes (based on the "a" series of changes)' |
|
763 | $ hg ci -m 'j-1: unrelated changes (based on the "a" series of changes)' | |
@@ -1001,6 +1055,7 b' Summary of all created cases' | |||||
1001 | l-1: unrelated changes (based on "c" changes) |
|
1055 | l-1: unrelated changes (based on "c" changes) | |
1002 | mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way |
|
1056 | mABm-0 simple merge - A side: multiple renames, B side: unrelated update - the other way | |
1003 | mAE,Km: chained merges (conflict -> simple) - same content everywhere |
|
1057 | mAE,Km: chained merges (conflict -> simple) - same content everywhere | |
|
1058 | 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 | |||
1004 | 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 |
|
1059 | 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 | |
1005 | mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way |
|
1060 | mBAm-0 simple merge - A side: multiple renames, B side: unrelated update - one way | |
1006 | mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists) |
|
1061 | mBC+revert,Lm: chained merges (salvaged -> simple) - same content (when the file exists) | |
@@ -1018,6 +1073,7 b' Summary of all created cases' | |||||
1018 | mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way |
|
1073 | mDBm-0 simple merge - B side: unrelated update, D side: delete and recreate a file (with different content) - the other way | |
1019 | mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way |
|
1074 | mDGm-0 actual content merge, copies on one side - D side: delete and re-add (different content), G side: update content - one way | |
1020 | mEA,Jm: chained merges (conflict -> simple) - same content everywhere |
|
1075 | mEA,Jm: chained merges (conflict -> simple) - same content everywhere | |
|
1076 | 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 | |||
1021 | 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 |
|
1077 | 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 | |
1022 | mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way |
|
1078 | mFBm-0 simple merge - B side: unrelated change, F side: overwrite d with a copy (from h->i->d) - the other way | |
1023 | mFG,Om: chained merges (copy-overwrite -> simple) - same content |
|
1079 | mFG,Om: chained merges (copy-overwrite -> simple) - same content | |
@@ -1278,6 +1334,16 b' We upgrade a repository that is not usin' | |||||
1278 | 1 sidedata entries |
|
1334 | 1 sidedata entries | |
1279 | entry-0014 size 4 |
|
1335 | entry-0014 size 4 | |
1280 | '\x00\x00\x00\x00' |
|
1336 | '\x00\x00\x00\x00' | |
|
1337 | ##### revision "mAE-change-m-0 merge with file update and copies info on both side - A side" ##### | |||
|
1338 | 1 sidedata entries | |||
|
1339 | entry-0014 size 14 | |||
|
1340 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f' | |||
|
1341 | merged : f, ; | |||
|
1342 | ##### revision "mEA-change-m-0 merge with file update and copies info on both side - A side" ##### | |||
|
1343 | 1 sidedata entries | |||
|
1344 | entry-0014 size 14 | |||
|
1345 | '\x00\x00\x00\x01\x08\x00\x00\x00\x01\x00\x00\x00\x00f' | |||
|
1346 | merged : f, ; | |||
1281 | ##### revision "j-1" ##### |
|
1347 | ##### revision "j-1" ##### | |
1282 | 1 sidedata entries |
|
1348 | 1 sidedata entries | |
1283 | entry-0014 size 24 |
|
1349 | entry-0014 size 24 | |
@@ -1628,6 +1694,8 b' Subcase: new copy information on both si' | |||||
1628 | 0 * b76eb76580df 000000000000 000000000000 |
|
1694 | 0 * b76eb76580df 000000000000 000000000000 | |
1629 | 1 * e8825b386367 000000000000 000000000000 |
|
1695 | 1 * e8825b386367 000000000000 000000000000 | |
1630 | 2 * 2ff93c643948 b76eb76580df e8825b386367 |
|
1696 | 2 * 2ff93c643948 b76eb76580df e8825b386367 | |
|
1697 | 3 * 2f649fba7eb2 b76eb76580df e8825b386367 | |||
|
1698 | 4 * 774e7c1637d5 e8825b386367 b76eb76580df | |||
1631 | #else |
|
1699 | #else | |
1632 | $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f' |
|
1700 | $ hg manifest --debug --rev 'desc("mAEm-0")' | grep '644 f' | |
1633 | ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f |
|
1701 | ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f | |
@@ -1640,6 +1708,8 b' Subcase: new copy information on both si' | |||||
1640 | $ hg debugindex f | ../no-linkrev |
|
1708 | $ hg debugindex f | ../no-linkrev | |
1641 | rev linkrev nodeid p1 p2 |
|
1709 | rev linkrev nodeid p1 p2 | |
1642 | 0 * ae258f702dfe 000000000000 000000000000 |
|
1710 | 0 * ae258f702dfe 000000000000 000000000000 | |
|
1711 | 1 * d3613c1ec831 ae258f702dfe 000000000000 | |||
|
1712 | 2 * 05e03c868bbc ae258f702dfe 000000000000 | |||
1643 | #endif |
|
1713 | #endif | |
1644 |
|
1714 | |||
1645 | # Here the filelog based implementation is not looking at the rename |
|
1715 | # Here the filelog based implementation is not looking at the rename | |
@@ -2191,6 +2261,133 b' rename information actually conflict wit' | |||||
2191 | $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")' |
|
2261 | $ hg status --copies --rev 'desc("h-1")' --rev 'desc("mHC-delete-before-conflict-m")' | |
2192 | R a |
|
2262 | R a | |
2193 |
|
2263 | |||
|
2264 | Variant of previous with extra changes introduced by the merge | |||
|
2265 | -------------------------------------------------------------- | |||
|
2266 | ||||
|
2267 | (see case declaration for details) | |||
|
2268 | ||||
|
2269 | Subcase: merge has same initial content on both side, but merge introduced a change | |||
|
2270 | ``````````````````````````````````````````````````````````````````````````````````` | |||
|
2271 | ||||
|
2272 | - the "e-" branch renaming b to f (through 'g') | |||
|
2273 | - the "a-" branch renaming d to f (through e) | |||
|
2274 | - the merge add new change to b | |||
|
2275 | ||||
|
2276 | $ hg log -G --rev '::(desc("mAE-change-m")+desc("mEA-change-m"))' | |||
|
2277 | 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 | |||
|
2278 | |\ | |||
|
2279 | +---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 | |||
|
2280 | | |/ | |||
|
2281 | | o e-2 g -move-> f | |||
|
2282 | | | | |||
|
2283 | | o e-1 b -move-> g | |||
|
2284 | | | | |||
|
2285 | o | a-2: e -move-> f | |||
|
2286 | | | | |||
|
2287 | o | a-1: d -move-> e | |||
|
2288 | |/ | |||
|
2289 | o i-2: c -move-> d | |||
|
2290 | | | |||
|
2291 | o i-1: a -move-> c | |||
|
2292 | | | |||
|
2293 | o i-0 initial commit: a b h | |||
|
2294 | ||||
|
2295 | #if no-changeset | |||
|
2296 | $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f' | |||
|
2297 | 2f649fba7eb284e720d02b61f0546fcef694c045 644 f | |||
|
2298 | $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f' | |||
|
2299 | 774e7c1637d536b99e2d8ef16fd731f87a82bd09 644 f | |||
|
2300 | $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f' | |||
|
2301 | b76eb76580df486c3d51d63c5c210d4dd43a8ac7 644 f | |||
|
2302 | $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' | |||
|
2303 | e8825b386367b29fec957283a80bb47b47483fe1 644 f | |||
|
2304 | $ hg debugindex f | ../no-linkrev | |||
|
2305 | rev linkrev nodeid p1 p2 | |||
|
2306 | 0 * b76eb76580df 000000000000 000000000000 | |||
|
2307 | 1 * e8825b386367 000000000000 000000000000 | |||
|
2308 | 2 * 2ff93c643948 b76eb76580df e8825b386367 | |||
|
2309 | 3 * 2f649fba7eb2 b76eb76580df e8825b386367 | |||
|
2310 | 4 * 774e7c1637d5 e8825b386367 b76eb76580df | |||
|
2311 | #else | |||
|
2312 | $ hg manifest --debug --rev 'desc("mAE-change-m-0")' | grep '644 f' | |||
|
2313 | d3613c1ec8310a812ac4268fd853ac576b6caea5 644 f | |||
|
2314 | $ hg manifest --debug --rev 'desc("mEA-change-m-0")' | grep '644 f' | |||
|
2315 | 05e03c868bbcab4a649cb33a238d7aa07398a469 644 f | |||
|
2316 | $ hg manifest --debug --rev 'desc("a-2")' | grep '644 f' | |||
|
2317 | ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f | |||
|
2318 | $ hg manifest --debug --rev 'desc("e-2")' | grep '644 f' | |||
|
2319 | ae258f702dfeca05bf9b6a22a97a4b5645570f11 644 f | |||
|
2320 | $ hg debugindex f | ../no-linkrev | |||
|
2321 | rev linkrev nodeid p1 p2 | |||
|
2322 | 0 * ae258f702dfe 000000000000 000000000000 | |||
|
2323 | 1 * d3613c1ec831 ae258f702dfe 000000000000 | |||
|
2324 | 2 * 05e03c868bbc ae258f702dfe 000000000000 | |||
|
2325 | #endif | |||
|
2326 | ||||
|
2327 | # Here the filelog based implementation is not looking at the rename | |||
|
2328 | # information (because the file exist on both side). However the changelog | |||
|
2329 | # based on works fine. We have different output. | |||
|
2330 | ||||
|
2331 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mAE-change-m-0")' | |||
|
2332 | M f | |||
|
2333 | b (no-filelog !) | |||
|
2334 | R b | |||
|
2335 | $ hg status --copies --rev 'desc("a-2")' --rev 'desc("mEA-change-m-0")' | |||
|
2336 | M f | |||
|
2337 | b (no-filelog !) | |||
|
2338 | R b | |||
|
2339 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mAE-change-m-0")' | |||
|
2340 | M f | |||
|
2341 | d (no-filelog !) | |||
|
2342 | R d | |||
|
2343 | $ hg status --copies --rev 'desc("e-2")' --rev 'desc("mEA-change-m-0")' | |||
|
2344 | M f | |||
|
2345 | d (no-filelog !) | |||
|
2346 | R d | |||
|
2347 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("a-2")' | |||
|
2348 | A f | |||
|
2349 | d | |||
|
2350 | R d | |||
|
2351 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("e-2")' | |||
|
2352 | A f | |||
|
2353 | b | |||
|
2354 | R b | |||
|
2355 | ||||
|
2356 | # From here, we run status against revision where both source file exists. | |||
|
2357 | # | |||
|
2358 | # The filelog based implementation picks an arbitrary side based on revision | |||
|
2359 | # numbers. So the same side "wins" whatever the parents order is. This is | |||
|
2360 | # sub-optimal because depending on revision numbers means the result can be | |||
|
2361 | # different from one repository to the next. | |||
|
2362 | # | |||
|
2363 | # The changeset based algorithm use the parent order to break tie on conflicting | |||
|
2364 | # information and will have a different order depending on who is p1 and p2. | |||
|
2365 | # That order is stable accross repositories. (data from p1 prevails) | |||
|
2366 | ||||
|
2367 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mAE-change-m-0")' | |||
|
2368 | A f | |||
|
2369 | d | |||
|
2370 | R b | |||
|
2371 | R d | |||
|
2372 | $ hg status --copies --rev 'desc("i-2")' --rev 'desc("mEA-change-m-0")' | |||
|
2373 | A f | |||
|
2374 | d (filelog !) | |||
|
2375 | b (no-filelog !) | |||
|
2376 | R b | |||
|
2377 | R d | |||
|
2378 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mAE-change-m-0")' | |||
|
2379 | A f | |||
|
2380 | a | |||
|
2381 | R a | |||
|
2382 | R b | |||
|
2383 | $ hg status --copies --rev 'desc("i-0")' --rev 'desc("mEA-change-m-0")' | |||
|
2384 | A f | |||
|
2385 | a (filelog !) | |||
|
2386 | b (no-filelog !) | |||
|
2387 | R a | |||
|
2388 | R b | |||
|
2389 | ||||
|
2390 | ||||
2194 | Decision from previous merge are properly chained with later merge |
|
2391 | Decision from previous merge are properly chained with later merge | |
2195 | ------------------------------------------------------------------ |
|
2392 | ------------------------------------------------------------------ | |
2196 |
|
2393 |
General Comments 0
You need to be logged in to leave comments.
Login now