comparison tests/test_fetch_branches.py @ 582:44c56a7727c4

editor: fix issamefile() and copy detection in replay mode Known failures: - comprehensive/test_verify on replace_branch_with_branch: replaced files content is incorrect - comprehensive/test_stupid_pull on replace_branch_with_branch: very stupid mode does not handle replacements correctly.
author Patrick Mezard <pmezard@gmail.com>
date Tue, 02 Mar 2010 17:06:06 +0100
parents d96aa92d9ad9
children c3ba4ca81d16
comparison
equal deleted inserted replaced
581:90efea2c19df 582:44c56a7727c4
129 repo = self._load_fixture_and_fetch('branch_delete_parent_dir.svndump', 129 repo = self._load_fixture_and_fetch('branch_delete_parent_dir.svndump',
130 stupid) 130 stupid)
131 self.assertEqual(node.hex(repo['tip'].node()), 131 self.assertEqual(node.hex(repo['tip'].node()),
132 '4108a81a82c7925d5551091165dc54c41b06a8a8') 132 '4108a81a82c7925d5551091165dc54c41b06a8a8')
133 133
134 def test_replace_branch_with_branch(self, stupid=False):
135 repo = self._load_fixture_and_fetch('replace_branch_with_branch.svndump',
136 stupid)
137 self.assertEqual(7, len(repo))
138 # tip is former topological branch1 being closed
139 ctx = repo['tip']
140 self.assertEqual('1', ctx.extra().get('close', '0'))
141 self.assertEqual('branch1', ctx.branch())
142 # r5 is where the replacement takes place
143 ctx = repo[5]
144 self.assertEqual(set(['a', 'c']), set(ctx))
145 self.assertEqual('0', ctx.extra().get('close', '0'))
146 self.assertEqual('branch1', ctx.branch())
147 self.assertEqual('c\n', ctx['c'].data())
148 # a replacement does not work yet
149 #self.assertEqual('d\n', ctx['a'].data())
150
151 def test_replace_branch_with_branch_stupid(self, stupid=False):
152 self.test_replace_branch_with_branch(True)
153
134 def suite(): 154 def suite():
135 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), 155 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
136 ] 156 ]
137 return unittest.TestSuite(all) 157 return unittest.TestSuite(all)