Mercurial > hgsubversion
comparison tests/test_fetch_branches.py @ 1103:6e1dbf6cbc92
compathacks: new module to collect hacks to work around hg internals changing
This includes branchset(), which provides a portable way to get the
set of branches present in a repository.
| author | Augie Fackler <raf@durin42.com> |
|---|---|
| date | Mon, 03 Feb 2014 01:55:56 -0500 |
| parents | 9a7e3dbd0f6e |
| children | ba8485b9fee0 |
comparison
equal
deleted
inserted
replaced
| 1102:7635d30effa7 | 1103:6e1dbf6cbc92 |
|---|---|
| 3 import unittest | 3 import unittest |
| 4 | 4 |
| 5 from mercurial import error | 5 from mercurial import error |
| 6 from mercurial import hg | 6 from mercurial import hg |
| 7 from mercurial import node | 7 from mercurial import node |
| 8 | |
| 9 from hgsubversion import compathacks | |
| 8 | 10 |
| 9 class TestFetchBranches(test_util.TestBase): | 11 class TestFetchBranches(test_util.TestBase): |
| 10 stupid_mode_tests = True | 12 stupid_mode_tests = True |
| 11 | 13 |
| 12 def _load_fixture_and_fetch_with_anchor(self, fixture_name, anchor): | 14 def _load_fixture_and_fetch_with_anchor(self, fixture_name, anchor): |
| 86 self.assertRaises(error.RepoLookupError, | 88 self.assertRaises(error.RepoLookupError, |
| 87 self._load_fixture_and_fetch_with_anchor, | 89 self._load_fixture_and_fetch_with_anchor, |
| 88 'unorderedbranch.svndump', 'NaN') | 90 'unorderedbranch.svndump', 'NaN') |
| 89 repo = self._load_fixture_and_fetch_with_anchor( | 91 repo = self._load_fixture_and_fetch_with_anchor( |
| 90 'unorderedbranch.svndump', '4') | 92 'unorderedbranch.svndump', '4') |
| 91 self.assertTrue('c' not in repo.branchtags()) | 93 self.assertTrue('c' not in compathacks.branchset(repo)) |
| 92 | 94 |
| 93 def test_branches_weird_moves(self): | 95 def test_branches_weird_moves(self): |
| 94 repo = self._load_fixture_and_fetch('renamedproject.svndump', | 96 repo = self._load_fixture_and_fetch('renamedproject.svndump', |
| 95 subdir='project') | 97 subdir='project') |
| 96 heads = [repo[n] for n in repo.heads()] | 98 heads = [repo[n] for n in repo.heads()] |
