comparison tests/test_fetch_branches.py @ 147:22162380c4b9

Improve branch closing in the case of a single-rev replacement of one branch with another. Includes a test case.
author Augie Fackler <durin42@gmail.com>
date Sat, 20 Dec 2008 19:04:59 -0600
parents 2242dd1163c6
children 6fa97cfbf62f
comparison
equal deleted inserted replaced
146:4da9f20aef01 147:22162380c4b9
28 self.assertEqual(0, r.parents()[0].rev()) 28 self.assertEqual(0, r.parents()[0].rev())
29 self.assertEqual(['a', 'c', 'z'], sorted(r.manifest())) 29 self.assertEqual(['a', 'c', 'z'], sorted(r.manifest()))
30 30
31 def test_unorderedbranch_stupid(self): 31 def test_unorderedbranch_stupid(self):
32 self.test_unorderedbranch(True) 32 self.test_unorderedbranch(True)
33 33
34 def test_renamed_branch_to_trunk(self, stupid=False): 34 def test_renamed_branch_to_trunk(self, stupid=False):
35 repo = self._load_fixture_and_fetch('branch_rename_to_trunk.svndump', 35 repo = self._load_fixture_and_fetch('branch_rename_to_trunk.svndump',
36 stupid) 36 stupid)
37 self.assertEqual(node.hex(repo['tip'].node()), 37 self.assertEqual(node.hex(repo['default'].node()),
38 'b479347c1f56d1fafe5e32a7ce0d1b7099637784') 38 'b479347c1f56d1fafe5e32a7ce0d1b7099637784')
39 self.assertEqual(repo['tip'].parents()[0].branch(), 'dev_branch') 39 self.assertEqual(repo['tip'].parents()[0].branch(), 'dev_branch')
40 self.assertEqual(repo['old_trunk'].parents()[0].branch(), 'default') 40 self.assertEqual(repo['old_trunk'].parents()[0].branch(), 'default')
41 41
42 def test_renamed_branch_to_trunk_stupid(self): 42 def test_renamed_branch_to_trunk_stupid(self):
43 self.test_renamed_branch_to_trunk(stupid=True) 43 self.test_renamed_branch_to_trunk(stupid=True)
44 44
45 def test_replace_trunk_with_branch(self, stupid=False):
46 repo = self._load_fixture_and_fetch('replace_trunk_with_branch.svndump',
47 stupid)
48 self.assertEqual(repo['default'].parents()[0].branch(), 'test')
49 self.assertEqual(node.hex(repo['closed-branches'].parents()[0].node()),
50 'f46d6f10e6329a069503af6c0c12903994c083b2')
51 self.assertEqual(node.hex(repo['default'].node()),
52 '7bb5386f1a8e752888183cd86e43bdaf9abd1a95')
53
54 def test_replace_trunk_with_branch_stupid(self):
55 self.test_replace_trunk_with_branch(stupid=True)
56
45 def suite(): 57 def suite():
46 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), 58 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
47 ] 59 ]
48 return unittest.TestSuite(all) 60 return unittest.TestSuite(all)