Mercurial > hgsubversion
comparison tests/test_fetch_branches.py @ 1093:791382a21cc4
layouts: add support for configuring branches directory
This should work for both alternately named directories (e.g. releases
instead of branches), as well as subdirs (branches/releases), and
combinations thereof (releases/public).
| author | David Schleimer <dschleimer@fb.com> |
|---|---|
| date | Tue, 11 Jun 2013 17:53:31 -0700 |
| parents | b8142bbf6656 |
| children | 9a7e3dbd0f6e |
comparison
equal
deleted
inserted
replaced
| 1092:cd0d14e25757 | 1093:791382a21cc4 |
|---|---|
| 126 self.assertEqual('f\n', ctx['f'].data()) | 126 self.assertEqual('f\n', ctx['f'].data()) |
| 127 self.assertEqual('g\n', ctx['g'].data()) | 127 self.assertEqual('g\n', ctx['g'].data()) |
| 128 for f in ctx: | 128 for f in ctx: |
| 129 self.assertTrue(not ctx[f].renamed()) | 129 self.assertTrue(not ctx[f].renamed()) |
| 130 | 130 |
| 131 def test_misspelled_branches_tags(self): | |
| 132 config = { | |
| 133 'hgsubversion.branchdir': 'branchez', | |
| 134 'hgsubversion.tagpaths': 'tagz', | |
| 135 } | |
| 136 '''Tests using the tags dir for branches and the branches dir for tags''' | |
| 137 repo = self._load_fixture_and_fetch('misspelled_branches_tags.svndump', | |
| 138 layout='standard', | |
| 139 config=config) | |
| 140 | |
| 141 heads = set([repo[n].branch() for n in repo.heads()]) | |
| 142 expected_heads = set(['default', 'branch']) | |
| 143 | |
| 144 self.assertEqual(heads, expected_heads) | |
| 145 | |
| 146 tags = set(repo.tags()) | |
| 147 expected_tags = set(['tip', 'tag_from_trunk', 'tag_from_branch']) | |
| 148 self.assertEqual(tags, expected_tags) | |
| 149 | |
| 150 def test_subdir_branches_tags(self): | |
| 151 '''Tests using the tags dir for branches and the branches dir for tags''' | |
| 152 config = { | |
| 153 'hgsubversion.branchdir': 'bran/ches', | |
| 154 'hgsubversion.tagpaths': 'ta/gs', | |
| 155 } | |
| 156 repo = self._load_fixture_and_fetch('subdir_branches_tags.svndump', | |
| 157 layout='standard', | |
| 158 config=config) | |
| 159 | |
| 160 heads = set([repo[n].branch() for n in repo.heads()]) | |
| 161 expected_heads = set(['default', 'branch']) | |
| 162 | |
| 163 self.assertEqual(heads, expected_heads) | |
| 164 | |
| 165 tags = set(repo.tags()) | |
| 166 expected_tags = set(['tip', 'tag_from_trunk', 'tag_from_branch']) | |
| 167 self.assertEqual(tags, expected_tags) | |
| 168 | |
| 169 def suite(): | |
| 170 all_tests = [unittest.TestLoader().loadTestsFromTestCase(TestFetchBranches), | |
| 171 ] | |
| 172 return unittest.TestSuite(all_tests) |
