comparison tests/test_fetch_branches.py @ 278:60acc38eac96

clone: prefer tip of default to overall tip when updating
author Martijn Pieters <mj@zopatista.com>
date Fri, 24 Apr 2009 20:36:38 -0500
parents c0063328587f
children f8f9a2993705
comparison
equal deleted inserted replaced
277:3848a7f9b983 278:60acc38eac96
4 4
5 import test_util 5 import test_util
6 6
7 7
8 class TestFetchBranches(test_util.TestBase): 8 class TestFetchBranches(test_util.TestBase):
9 def _load_fixture_and_fetch(self, fixture_name, stupid): 9 def _load_fixture_and_fetch(self, fixture_name, stupid, noupdate=True):
10 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, 10 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path,
11 self.wc_path, stupid=stupid) 11 self.wc_path, stupid=stupid,
12 noupdate=noupdate)
12 13
13 def test_unrelatedbranch(self, stupid=False): 14 def test_unrelatedbranch(self, stupid=False):
14 repo = self._load_fixture_and_fetch('unrelatedbranch.svndump', stupid) 15 repo = self._load_fixture_and_fetch('unrelatedbranch.svndump', stupid)
15 heads = [repo[n] for n in repo.heads()] 16 heads = [repo[n] for n in repo.heads()]
16 heads = dict([(ctx.branch(), ctx) for ctx in heads]) 17 heads = dict([(ctx.branch(), ctx) for ctx in heads])
57 repo = self._load_fixture_and_fetch('branch_create_with_dir_delete.svndump', 58 repo = self._load_fixture_and_fetch('branch_create_with_dir_delete.svndump',
58 stupid) 59 stupid)
59 self.assertEqual(repo['tip'].manifest().keys(), 60 self.assertEqual(repo['tip'].manifest().keys(),
60 ['alpha', 'beta', 'iota', 'gamma', ]) 61 ['alpha', 'beta', 'iota', 'gamma', ])
61 62
63 def test_branch_tip_update_to_default(self, stupid=False):
64 repo = self._load_fixture_and_fetch('unorderedbranch.svndump',
65 stupid, noupdate=False)
66 self.assertEqual(repo[None].branch(), 'default')
67 self.assertTrue('tip' not in repo[None].tags())
68
69 def test_branch_tip_update_to_default_stupid(self):
70 self.test_branch_tip_update_to_default(True)
71
62 def suite(): 72 def suite():
63 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), 73 all = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
64 ] 74 ]
65 return unittest.TestSuite(all) 75 return unittest.TestSuite(all)