Mercurial > hgsubversion
comparison tests/test_tags.py @ 474:63cb630d667d
tags: handle the most recent commit being an edit to an svn tag properly
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Sat, 18 Jul 2009 22:30:59 -0500 |
| parents | bb612e625be6 |
| children | 839734dfb5c7 |
comparison
equal
deleted
inserted
replaced
| 473:45df4d9320fa | 474:63cb630d667d |
|---|---|
| 6 from mercurial import node | 6 from mercurial import node |
| 7 from mercurial import ui | 7 from mercurial import ui |
| 8 | 8 |
| 9 import test_util | 9 import test_util |
| 10 | 10 |
| 11 from hgsubversion import svncommands | |
| 11 from hgsubversion import svnrepo | 12 from hgsubversion import svnrepo |
| 12 | 13 |
| 13 class TestTags(test_util.TestBase): | 14 class TestTags(test_util.TestBase): |
| 14 def _load_fixture_and_fetch(self, fixture_name, stupid=False): | 15 def _load_fixture_and_fetch(self, fixture_name, stupid=False): |
| 15 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, | 16 return test_util.load_fixture_and_fetch(fixture_name, self.repo_path, |
| 85 self.assertEqual( | 86 self.assertEqual( |
| 86 tags, | 87 tags, |
| 87 {'blah/trunktag': '\xd3$@\xd7\xd8Nu\xce\xa6%\xf1u\xd9b\x1a\xb2\x81\xc2\xb0\xb1', | 88 {'blah/trunktag': '\xd3$@\xd7\xd8Nu\xce\xa6%\xf1u\xd9b\x1a\xb2\x81\xc2\xb0\xb1', |
| 88 'versions/branch_version': 'I\x89\x1c>z#\xfc._K#@:\xd6\x1f\x96\xd6\x83\x1b|', | 89 'versions/branch_version': 'I\x89\x1c>z#\xfc._K#@:\xd6\x1f\x96\xd6\x83\x1b|', |
| 89 }) | 90 }) |
| 91 | |
| 92 def test_most_recent_is_edited_stupid(self): | |
| 93 self.test_most_recent_is_edited(True) | |
| 94 | |
| 95 def test_most_recent_is_edited(self, stupid=False): | |
| 96 repo = self._load_fixture_and_fetch('most-recent-is-edit-tag.svndump', | |
| 97 stupid=stupid) | |
| 98 self.repo.ui.status( | |
| 99 "Note: this test failing may be because of a rebuildmeta failure.\n" | |
| 100 "You should check that before assuming issues with this test.\n") | |
| 101 wc2_path = self.wc_path + '2' | |
| 102 src, dest = hg.clone(repo.ui, self.wc_path, wc2_path, update=False) | |
| 103 svncommands.rebuildmeta(repo.ui, | |
| 104 dest, | |
| 105 os.path.dirname(dest.path), | |
| 106 args=[test_util.fileurl(self.repo_path), ]) | |
| 107 commands.pull(self.repo.ui, self.repo, stupid=stupid) | |
| 108 dtags, srctags = dest.tags(), self.repo.tags() | |
| 109 dtags.pop('tip') | |
| 110 srctags.pop('tip') | |
| 111 self.assertEqual(dtags, srctags) | |
| 112 self.assertEqual(dest.heads(), self.repo.heads()) | |
| 90 | 113 |
| 91 def test_edited_tag_stupid(self): | 114 def test_edited_tag_stupid(self): |
| 92 self.test_edited_tag(True) | 115 self.test_edited_tag(True) |
| 93 | 116 |
| 94 def test_edited_tag(self, stupid=False): | 117 def test_edited_tag(self, stupid=False): |
