Mercurial > hgsubversion
comparison tests/test_tags.py @ 447:0d3b5acb1d51
tags: handle edits to tags as gracefully as possible
| author | Augie Fackler <durin42@gmail.com> |
|---|---|
| date | Tue, 23 Jun 2009 21:38:27 -0500 |
| parents | f5222d021665 |
| children | bda5b47ad2a2 |
comparison
equal
deleted
inserted
replaced
| 446:cbd230043379 | 447:0d3b5acb1d51 |
|---|---|
| 84 tags, | 84 tags, |
| 85 {'blah/trunktag': '\xd3$@\xd7\xd8Nu\xce\xa6%\xf1u\xd9b\x1a\xb2\x81\xc2\xb0\xb1', | 85 {'blah/trunktag': '\xd3$@\xd7\xd8Nu\xce\xa6%\xf1u\xd9b\x1a\xb2\x81\xc2\xb0\xb1', |
| 86 'versions/branch_version': 'I\x89\x1c>z#\xfc._K#@:\xd6\x1f\x96\xd6\x83\x1b|', | 86 'versions/branch_version': 'I\x89\x1c>z#\xfc._K#@:\xd6\x1f\x96\xd6\x83\x1b|', |
| 87 }) | 87 }) |
| 88 | 88 |
| 89 def test_edited_tag_stupid(self): | |
| 90 self.test_edited_tag(True) | |
| 91 | |
| 92 def test_edited_tag(self, stupid=False): | |
| 93 repo = self._load_fixture_and_fetch('commit-to-tag.svndump', | |
| 94 stupid=stupid) | |
| 95 self.assertEqual(len(repo.heads()), 2) | |
| 96 heads = repo.heads() | |
| 97 openheads = [h for h in heads if not repo[h].extra().get('close', False)] | |
| 98 closedheads = set(heads) - set(openheads) | |
| 99 self.assertEqual(len(openheads), 1) | |
| 100 self.assertEqual(len(closedheads), 1) | |
| 101 tagged = list(closedheads)[0] | |
| 102 self.assertEqual( | |
| 103 repo[tagged].extra(), | |
| 104 {'close': '1', | |
| 105 'branch': 'magic', | |
| 106 'convert_revision': 'svn:af82cc90-c2d2-43cd-b1aa-c8a78449440a/tags/will-edit@9'}) | |
| 107 self.assertEqual(tagged, repo.tags()['will-edit']) | |
| 108 self.assertEqual(repo['will-edit'].manifest().keys(), ['beta', | |
| 109 'gamma', | |
| 110 ]) | |
| 89 | 111 |
| 90 def test_tags_in_unusual_location(self): | 112 def test_tags_in_unusual_location(self): |
| 91 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') | 113 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') |
| 92 self.assertEqual(len(repo.heads()), 1) | 114 self.assertEqual(len(repo.heads()), 1) |
| 93 branches = set(repo[h].extra()['branch'] | 115 branches = set(repo[h].extra()['branch'] |
