comparison tests/test_tags.py @ 425:f5222d021665

tests: fix for new branch heads change in upstream hg.
author Augie Fackler <durin42@gmail.com>
date Mon, 15 Jun 2009 12:26:19 -0500
parents 94f7e8c53c36
children 0d3b5acb1d51
comparison
equal deleted inserted replaced
424:3ae8edc3d8f1 425:f5222d021665
52 self.test_branch_from_tag(stupid=True) 52 self.test_branch_from_tag(stupid=True)
53 53
54 def test_tag_by_renaming_branch(self, stupid=False): 54 def test_tag_by_renaming_branch(self, stupid=False):
55 repo = self._load_fixture_and_fetch('tag_by_rename_branch.svndump', 55 repo = self._load_fixture_and_fetch('tag_by_rename_branch.svndump',
56 stupid=stupid) 56 stupid=stupid)
57 branches = set(repo[h] for h in repo.heads(closed=False)) 57 branches = set(repo[h] for h in repo.heads())
58 self.assert_('dummy' not in branches) 58 self.assert_('dummy' not in branches)
59 self.assertEqual(repo['dummy'], repo['tip'].parents()[0]) 59 self.assertEqual(repo['dummy'], repo['tip'].parents()[0])
60 extra = repo['tip'].extra().copy() 60 extra = repo['tip'].extra().copy()
61 extra.pop('convert_revision', None) 61 extra.pop('convert_revision', None)
62 self.assertEqual(extra, {'branch': 'dummy', 'close': '1'}) 62 self.assertEqual(extra, {'branch': 'dummy', 'close': '1'})
64 def test_tag_by_renaming_branch_stupid(self): 64 def test_tag_by_renaming_branch_stupid(self):
65 self.test_tag_by_renaming_branch(stupid=True) 65 self.test_tag_by_renaming_branch(stupid=True)
66 66
67 def test_deletion_of_tag_on_trunk_after_branching(self): 67 def test_deletion_of_tag_on_trunk_after_branching(self):
68 repo = self._load_fixture_and_fetch('tag_deletion_tag_branch.svndump') 68 repo = self._load_fixture_and_fetch('tag_deletion_tag_branch.svndump')
69 branches = set(repo[h].extra()['branch'] for h in repo.heads(closed=False)) 69 branches = set(repo[h].extra()['branch'] for h in repo.heads())
70 self.assertEqual(branches, set(['default', 'from_2', ])) 70 self.assertEqual(branches, set(['default', 'from_2', ]))
71 self.assertEqual( 71 self.assertEqual(
72 repo.tags(), 72 repo.tags(),
73 {'tip': 'g\xdd\xcd\x93\x03g\x1e\x7f\xa6-[V%\x99\x07\xd3\x9d>(\x94', 73 {'tip': 'g\xdd\xcd\x93\x03g\x1e\x7f\xa6-[V%\x99\x07\xd3\x9d>(\x94',
74 'new_tag': '=\xb8^\xb5\x18\xa9M\xdb\xf9\xb62Z\xa0\xb5R6+\xfe6.'}) 74 'new_tag': '=\xb8^\xb5\x18\xa9M\xdb\xf9\xb62Z\xa0\xb5R6+\xfe6.'})
75 75
76 def test_tags_in_unusual_location(self): 76 def test_tags_in_unusual_location(self):
77 repo = self._load_fixture_and_fetch('unusual_tags.svndump') 77 repo = self._load_fixture_and_fetch('unusual_tags.svndump')
78 branches = set(repo[h].extra()['branch'] 78 branches = set(repo[h].extra()['branch']
79 for h in repo.heads(closed=False)) 79 for h in repo.heads())
80 self.assertEqual(branches, set(['default', 'dev_branch'])) 80 self.assertEqual(branches, set(['default', 'dev_branch']))
81 tags = repo.tags() 81 tags = repo.tags()
82 del tags['tip'] 82 del tags['tip']
83 self.assertEqual( 83 self.assertEqual(
84 tags, 84 tags,
89 89
90 def test_tags_in_unusual_location(self): 90 def test_tags_in_unusual_location(self):
91 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') 91 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump')
92 self.assertEqual(len(repo.heads()), 1) 92 self.assertEqual(len(repo.heads()), 1)
93 branches = set(repo[h].extra()['branch'] 93 branches = set(repo[h].extra()['branch']
94 for h in repo.heads(closed=False)) 94 for h in repo.heads())
95 self.assertEqual(branches, set(['magic', ])) 95 self.assertEqual(branches, set(['magic', ]))
96 tags = repo.tags() 96 tags = repo.tags()
97 del tags['tip'] 97 del tags['tip']
98 self.assertEqual( 98 self.assertEqual(
99 tags, 99 tags,