| 655 | |
| 656 | |
| 657 | class TestMerge(TestOp): |
| 658 | |
| 659 | def test_uncommitted_changes(self): |
| 660 | utils.write_file(self.MASTER_FILE, contents='uncommitted') |
| 661 | utils.write_file('master_untracked', contents='uncommitted') |
| 662 | gl.merge(self.OTHER) |
| 663 | self.assertEqual('uncommitted', utils.read_file(self.MASTER_FILE)) |
| 664 | self.assertEqual('uncommitted', utils.read_file('master_untracked')) |
| 665 | |
| 666 | def test_uncommitted_tracked_changes_that_conflict(self): |
| 667 | gl.branch(c='tmp', divergent_point='HEAD~1') |
| 668 | gl.switch('tmp') |
| 669 | utils.write_file(self.MASTER_FILE, contents='uncommitted') |
| 670 | self.assertRaisesRegexp( |
| 671 | ErrorReturnCode, 'failed to apply', gl.merge, 'master') |
| 672 | contents = utils.read_file(self.MASTER_FILE) |
| 673 | self.assertTrue('uncommitted' in contents) |
| 674 | self.assertTrue('contents 2' in contents) |
| 675 | |
| 676 | def test_uncommitted_tracked_changes_that_conflict_append(self): |
| 677 | gl.branch(c='tmp', divergent_point='HEAD~1') |
| 678 | gl.switch('tmp') |
| 679 | utils.append_to_file(self.MASTER_FILE, contents='uncommitted') |
| 680 | self.assertRaisesRegexp( |
| 681 | ErrorReturnCode, 'failed to apply', gl.merge, 'master') |
| 682 | contents = utils.read_file(self.MASTER_FILE) |
| 683 | self.assertTrue('uncommitted' in contents) |
| 684 | self.assertTrue('contents 2' in contents) |
| 685 | |
| 686 | |
| 687 | class TestPerformance(TestEndToEnd): |
nothing calls this directly
no outgoing calls
no test coverage detected