comparison tests/test_fetch_branches.py @ 1094:9a7e3dbd0f6e

layouts: add support for an infix between tbt and the hg root
author David Schleimer <dschleimer@fb.com>
date Wed, 11 Sep 2013 10:55:01 -0700
parents 791382a21cc4
children 6e1dbf6cbc92
comparison
equal deleted inserted replaced
1093:791382a21cc4 1094:9a7e3dbd0f6e
164 164
165 tags = set(repo.tags()) 165 tags = set(repo.tags())
166 expected_tags = set(['tip', 'tag_from_trunk', 'tag_from_branch']) 166 expected_tags = set(['tip', 'tag_from_trunk', 'tag_from_branch'])
167 self.assertEqual(tags, expected_tags) 167 self.assertEqual(tags, expected_tags)
168 168
169 def test_subproject_fetch(self):
170 config = {
171 'hgsubversion.infix': 'project',
172 }
173 repo = self._load_fixture_and_fetch('subprojects.svndump',
174 layout='standard',
175 config=config)
176
177 heads = set([repo[n].branch() for n in repo.heads()])
178 expected_heads = set(['default', 'branch'])
179 self.assertEqual(heads, expected_heads)
180
181 tags = set(repo.tags())
182 expected_tags = set(['tip', 'tag_from_trunk', 'tag_from_branch'])
183 self.assertEqual(tags, expected_tags)
184
185 for head in repo.heads():
186 ctx = repo[head]
187 self.assertFalse('project/file' in ctx, 'failed to strip infix')
188 self.assertTrue('file' in ctx, 'failed to track a simple file')
189 self.assertFalse('other/phile' in ctx, 'pulled in other project')
190 self.assertFalse('phile' in ctx, 'merged other project in repo')
191
192
169 def suite(): 193 def suite():
170 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), 194 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches),
171 ] 195 ]
172 return unittest.TestSuite(all_tests) 196 return unittest.TestSuite(all_tests)