Mercurial > hgsubversion
comparison tests/test_tags.py @ 547:9e6499c415a9
tags: fix files edited during tag creation
This was broken because file edits were skipped if they were in tags, but
committags in svnmeta didn't check to see if any files were changed during
initial tag creation.
author | Augie Fackler <durin42@gmail.com> |
---|---|
date | Sat, 06 Feb 2010 10:36:21 -0600 |
parents | ebd8fb1a05e4 |
children | 00393e9abff8 |
comparison
equal
deleted
inserted
replaced
546:d84116dda52d | 547:9e6499c415a9 |
---|---|
129 self.test_edited_tag(True) | 129 self.test_edited_tag(True) |
130 | 130 |
131 def test_edited_tag(self, stupid=False): | 131 def test_edited_tag(self, stupid=False): |
132 repo = self._load_fixture_and_fetch('commit-to-tag.svndump', | 132 repo = self._load_fixture_and_fetch('commit-to-tag.svndump', |
133 stupid=stupid) | 133 stupid=stupid) |
134 self.assertEqual(len(repo.heads()), 5) | 134 headcount = 6 |
135 self.assertEqual(len(repo.heads()), headcount) | |
135 heads = repo.heads() | 136 heads = repo.heads() |
136 openheads = [h for h in heads if not repo[h].extra().get('close', False)] | 137 openheads = [h for h in heads if not repo[h].extra().get('close', False)] |
137 closedheads = set(heads) - set(openheads) | 138 closedheads = set(heads) - set(openheads) |
138 self.assertEqual(len(openheads), 1) | 139 self.assertEqual(len(openheads), 1) |
139 self.assertEqual(len(closedheads), headcount-1) | 140 self.assertEqual(len(closedheads), headcount-1) |
144 for h in openheads: | 145 for h in openheads: |
145 self.assertNotEqual('closeme', repo[openheads[0]].branch()) | 146 self.assertNotEqual('closeme', repo[openheads[0]].branch()) |
146 | 147 |
147 self.assertEqual(1, len(self.repo.branchheads('magic'))) | 148 self.assertEqual(1, len(self.repo.branchheads('magic'))) |
148 | 149 |
149 alsoedit, editlater, closeme, willedit, = closedheads | 150 alsoedit, editlater, closeme, willedit, editcreate, = closedheads |
150 self.assertEqual( | 151 self.assertEqual( |
151 repo[willedit].extra(), | 152 repo[willedit].extra(), |
152 {'close': '1', | 153 {'close': '1', |
153 'branch': 'magic', | 154 'branch': 'magic', |
154 'convert_revision': 'svn:af82cc90-c2d2-43cd-b1aa-c8a78449440a/tags/will-edit@19'}) | 155 'convert_revision': 'svn:af82cc90-c2d2-43cd-b1aa-c8a78449440a/tags/will-edit@19'}) |
178 self.assertEqual( | 179 self.assertEqual( |
179 repo[closeme].extra(), | 180 repo[closeme].extra(), |
180 {'close': '1', | 181 {'close': '1', |
181 'branch': 'closeme', | 182 'branch': 'closeme', |
182 'convert_revision': 'svn:af82cc90-c2d2-43cd-b1aa-c8a78449440a/branches/closeme@17'}) | 183 'convert_revision': 'svn:af82cc90-c2d2-43cd-b1aa-c8a78449440a/branches/closeme@17'}) |
184 self.assertEqual('alpha\nalpha\n', repo['edit-at-create']['alpha'].data()) | |
183 | 185 |
184 def test_tags_in_unusual_location(self): | 186 def test_tags_in_unusual_location(self): |
185 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') | 187 repo = self._load_fixture_and_fetch('tag_name_same_as_branch.svndump') |
186 self.assertEqual(len(repo.heads()), 1) | 188 self.assertEqual(len(repo.heads()), 1) |
187 branches = set(repo[h].extra()['branch'] | 189 branches = set(repo[h].extra()['branch'] |