comparison tests/test-evolve.t @ 4587:90cc85a82be7

test: move a test to an appropriate test file This patch introduce a new test file test-evolve-orphan-corner-cases.t for tests which covers corner cases.
author Sushil khanchi <sushilkhanchi97@gmail.com>
date Sun, 21 Apr 2019 13:04:40 +0530
parents 1b91a518d10c
children 30a544904238
comparison
equal deleted inserted replaced
4586:1b91a518d10c 4587:90cc85a82be7
1447 @ 1:ab832e43dd5a added a (book) 1447 @ 1:ab832e43dd5a added a (book)
1448 1448
1449 x 0:f7ad41964313 added a () 1449 x 0:f7ad41964313 added a ()
1450 1450
1451 $ cd .. 1451 $ cd ..
1452
1453 Test to make sure that `lastsolved` always has correct value and things don't break:
1454 ------------------------------------------------------------------------------------
1455 (before we were not updating it in case of orphan merge)
1456
1457 Prepare the repo:
1458 $ hg init orphanmergerepo
1459 $ cd orphanmergerepo
1460 $ echo a > a
1461 $ for fn in a b c; do echo foo > $fn; hg ci -Am "added "$fn; done;
1462 adding a
1463 adding b
1464 adding c
1465 Let's create a merge commit so that we can create orphan merge later:
1466 $ hg up 1 -q
1467 $ echo feature > f
1468 $ hg ci -Am "added feature f"
1469 adding f
1470 created new head
1471 $ hg merge
1472 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1473 (branch merge, don't forget to commit)
1474 $ hg ci -m "merge feature branch"
1475 $ glog
1476 @ 4:2c0a98d38026@default(draft) merge feature branch
1477 |\
1478 | o 3:4c33e511041e@default(draft) added feature f
1479 | |
1480 o | 2:8be98ac1a569@default(draft) added c
1481 |/
1482 o 1:80e6d2c47cfe@default(draft) added b
1483 |
1484 o 0:f7ad41964313@default(draft) added a
1485
1486
1487 Now make the parents of merge commit obsolete to get a orphan merge:
1488 $ hg up 2 -q
1489 $ echo "fixit" > c
1490 $ hg ci --amend -m "updated c"
1491 1 new orphan changesets
1492 $ hg up 3 -q
1493 $ echo "fixit" > c
1494 $ hg ci --amend -m "updated f"
1495 $ glog
1496 @ 6:086d9bedcd75@default(draft) updated f
1497 |
1498 | o 5:f84f2c548fbc@default(draft) updated c
1499 |/
1500 | * 4:2c0a98d38026@default(draft) merge feature branch
1501 | |\
1502 +---x 3:4c33e511041e@default(draft) added feature f
1503 | |
1504 | x 2:8be98ac1a569@default(draft) added c
1505 |/
1506 o 1:80e6d2c47cfe@default(draft) added b
1507 |
1508 o 0:f7ad41964313@default(draft) added a
1509
1510
1511 To check `lastsolved` contain right value after completion of orphan-merge
1512 resolution there should be one more instability to be evolved; lets create one:
1513 $ hg up 1 -q
1514 $ echo d > d
1515 $ hg ci -Am "added d"
1516 adding c
1517 adding d
1518 created new head
1519 $ echo e > e
1520 $ hg ci -Am "added e"
1521 adding e
1522 $ hg up .^
1523 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1524 $ echo "updated d" >> d
1525 $ hg ci --amend -m "updated d"
1526 1 new orphan changesets
1527 $ glog
1528 @ 9:7c4d1834c346@default(draft) updated d
1529 |
1530 | * 8:421f7614462a@default(draft) added e
1531 | |
1532 | x 7:afe5acea1990@default(draft) added d
1533 |/
1534 | o 6:086d9bedcd75@default(draft) updated f
1535 |/
1536 | o 5:f84f2c548fbc@default(draft) updated c
1537 |/
1538 | * 4:2c0a98d38026@default(draft) merge feature branch
1539 | |\
1540 +---x 3:4c33e511041e@default(draft) added feature f
1541 | |
1542 | x 2:8be98ac1a569@default(draft) added c
1543 |/
1544 o 1:80e6d2c47cfe@default(draft) added b
1545 |
1546 o 0:f7ad41964313@default(draft) added a
1547
1548 Now we have one orphan merge and one more orphan cset that we just created.
1549 Lets evolve:
1550 $ hg evolve --all --any
1551 move:[4] merge feature branch
1552 atop:[5] updated c
1553 move:[10] merge feature branch
1554 atop:[6] updated f
1555 move:[8] added e
1556 atop:[9] updated d