comparison tests/test_tags.py @ 28:9c481cae0428

Change the format of generated tags so they are tag/$tag instead of tag:$tag so that you can use them as revision args in diff.
author Augie Fackler <durin42@gmail.com>
date Fri, 10 Oct 2008 14:19:06 -0500
parents 1f8854804795
children 2d319e162598
comparison
equal deleted inserted replaced
27:b66ed66c82e4 28:9c481cae0428
37 repo = self._load_fixture_and_fetch('basic_tag_tests.svndump', 37 repo = self._load_fixture_and_fetch('basic_tag_tests.svndump',
38 stupid=stupid) 38 stupid=stupid)
39 self._test_tag_revision_info(repo) 39 self._test_tag_revision_info(repo)
40 svncommand.generate_hg_tags(ui.ui(), self.wc_path) 40 svncommand.generate_hg_tags(ui.ui(), self.wc_path)
41 repo = hg.repository(ui.ui(), self.wc_path) 41 repo = hg.repository(ui.ui(), self.wc_path)
42 self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node()) 42 self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
43 self.assertEqual(repo['tip'].node(), repo['tag:copied_tag'].node()) 43 self.assertEqual(repo['tip'].node(), repo['tag/copied_tag'].node())
44 44
45 def test_tags_stupid(self): 45 def test_tags_stupid(self):
46 self.test_tags(stupid=True) 46 self.test_tags(stupid=True)
47 47
48 def test_remove_tag(self, stupid=False): 48 def test_remove_tag(self, stupid=False):
49 repo = self._load_fixture_and_fetch('remove_tag_test.svndump', 49 repo = self._load_fixture_and_fetch('remove_tag_test.svndump',
50 stupid=stupid) 50 stupid=stupid)
51 self._test_tag_revision_info(repo) 51 self._test_tag_revision_info(repo)
52 svncommand.generate_hg_tags(ui.ui(), self.wc_path) 52 svncommand.generate_hg_tags(ui.ui(), self.wc_path)
53 repo = hg.repository(ui.ui(), self.wc_path) 53 repo = hg.repository(ui.ui(), self.wc_path)
54 self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node()) 54 self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
55 self.assert_('tag:copied_tag' not in repo.tags()) 55 self.assert_('tag/copied_tag' not in repo.tags())
56 56
57 def test_remove_tag_stupid(self): 57 def test_remove_tag_stupid(self):
58 self.test_remove_tag(stupid=True) 58 self.test_remove_tag(stupid=True)
59 59
60 def test_rename_tag(self, stupid=False): 60 def test_rename_tag(self, stupid=False):
61 repo = self._load_fixture_and_fetch('rename_tag_test.svndump', 61 repo = self._load_fixture_and_fetch('rename_tag_test.svndump',
62 stupid=stupid) 62 stupid=stupid)
63 self._test_tag_revision_info(repo) 63 self._test_tag_revision_info(repo)
64 svncommand.generate_hg_tags(ui.ui(), self.wc_path) 64 svncommand.generate_hg_tags(ui.ui(), self.wc_path)
65 repo = hg.repository(ui.ui(), self.wc_path) 65 repo = hg.repository(ui.ui(), self.wc_path)
66 self.assertEqual(repo['tip'].node(), repo['tag:tag_r3'].node()) 66 self.assertEqual(repo['tip'].node(), repo['tag/tag_r3'].node())
67 self.assertEqual(repo['tip'].node(), repo['tag:other_tag_r3'].node()) 67 self.assertEqual(repo['tip'].node(), repo['tag/other_tag_r3'].node())
68 self.assert_('tag:copied_tag' not in repo.tags()) 68 self.assert_('tag/copied_tag' not in repo.tags())
69 69
70 def test_rename_tag_stupid(self): 70 def test_rename_tag_stupid(self):
71 self.test_rename_tag(stupid=True) 71 self.test_rename_tag(stupid=True)
72 72
73 def test_branch_from_tag(self, stupid=False): 73 def test_branch_from_tag(self, stupid=False):
74 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 74 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
75 stupid=stupid) 75 stupid=stupid)
76 svncommand.generate_hg_tags(ui.ui(), self.wc_path) 76 svncommand.generate_hg_tags(ui.ui(), self.wc_path)
77 repo = hg.repository(ui.ui(), self.wc_path) 77 repo = hg.repository(ui.ui(), self.wc_path)
78 self.assertEqual(repo['tip'].node(), repo['branch_from_tag'].node()) 78 self.assertEqual(repo['tip'].node(), repo['branch_from_tag'].node())
79 self.assertEqual(repo[1].node(), repo['tag:tag_r3'].node()) 79 self.assertEqual(repo[1].node(), repo['tag/tag_r3'].node())
80 self.assertEqual(repo['branch_from_tag'].parents()[0].node(), 80 self.assertEqual(repo['branch_from_tag'].parents()[0].node(),
81 repo['tag:copied_tag'].node()) 81 repo['tag/copied_tag'].node())
82 82
83 def test_branch_from_tag_stupid(self): 83 def test_branch_from_tag_stupid(self):
84 self.test_branch_from_tag(stupid=True) 84 self.test_branch_from_tag(stupid=True)
85 85
86 def suite(): 86 def suite():