Mercurial > hgsubversion
comparison tests/test_single_dir_clone.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 | 2668785264d7 |
children | a36e87ae2380 |
comparison
equal
deleted
inserted
replaced
1102:7635d30effa7 | 1103:6e1dbf6cbc92 |
---|---|
8 from mercurial import context | 8 from mercurial import context |
9 from mercurial import hg | 9 from mercurial import hg |
10 from mercurial import node | 10 from mercurial import node |
11 from mercurial import ui | 11 from mercurial import ui |
12 | 12 |
13 from hgsubversion import compathacks | |
14 | |
13 class TestSingleDirClone(test_util.TestBase): | 15 class TestSingleDirClone(test_util.TestBase): |
14 stupid_mode_tests = True | 16 stupid_mode_tests = True |
15 | 17 |
16 def test_clone_single_dir_simple(self): | 18 def test_clone_single_dir_simple(self): |
17 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', | 19 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
18 layout='single', | 20 layout='single', |
19 subdir='') | 21 subdir='') |
20 self.assertEqual(repo.branchtags().keys(), ['default']) | 22 self.assertEqual(compathacks.branchset(repo), |
23 set(['default'])) | |
21 self.assertEqual(repo['tip'].manifest().keys(), | 24 self.assertEqual(repo['tip'].manifest().keys(), |
22 ['trunk/beta', | 25 ['trunk/beta', |
23 'tags/copied_tag/alpha', | 26 'tags/copied_tag/alpha', |
24 'trunk/alpha', | 27 'trunk/alpha', |
25 'tags/copied_tag/beta', | 28 'tags/copied_tag/beta', |
29 'branches/branch_from_tag/beta']) | 32 'branches/branch_from_tag/beta']) |
30 | 33 |
31 def test_auto_detect_single(self): | 34 def test_auto_detect_single(self): |
32 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', | 35 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
33 layout='auto') | 36 layout='auto') |
34 self.assertEqual(repo.branchtags().keys(), ['default', | 37 self.assertEqual(compathacks.branchset(repo), |
35 'branch_from_tag']) | 38 set(['default', 'branch_from_tag'])) |
36 oldmanifest = test_util.filtermanifest(repo['default'].manifest().keys()) | 39 oldmanifest = test_util.filtermanifest(repo['default'].manifest().keys()) |
37 # remove standard layout | 40 # remove standard layout |
38 shutil.rmtree(self.wc_path) | 41 shutil.rmtree(self.wc_path) |
39 # try again with subdir to get single dir clone | 42 # try again with subdir to get single dir clone |
40 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', | 43 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', |
41 layout='auto', | 44 layout='auto', |
42 subdir='trunk') | 45 subdir='trunk') |
43 self.assertEqual(repo.branchtags().keys(), ['default', ]) | 46 self.assertEqual(compathacks.branchset(repo), set(['default', ])) |
44 self.assertEqual(repo['default'].manifest().keys(), oldmanifest) | 47 self.assertEqual(repo['default'].manifest().keys(), oldmanifest) |
45 | 48 |
46 def test_clone_subdir_is_file_prefix(self): | 49 def test_clone_subdir_is_file_prefix(self): |
47 FIXTURE = 'subdir_is_file_prefix.svndump' | 50 FIXTURE = 'subdir_is_file_prefix.svndump' |
48 repo = self._load_fixture_and_fetch(FIXTURE, | 51 repo = self._load_fixture_and_fetch(FIXTURE, |
49 layout='single', | 52 layout='single', |
50 subdir=test_util.subdir[FIXTURE]) | 53 subdir=test_util.subdir[FIXTURE]) |
51 self.assertEqual(repo.branchtags().keys(), ['default']) | 54 self.assertEqual(compathacks.branchset(repo), set(['default'])) |
52 self.assertEqual(repo['tip'].manifest().keys(), ['flaf.txt']) | 55 self.assertEqual(repo['tip'].manifest().keys(), ['flaf.txt']) |
53 | 56 |
54 def test_externals_single(self): | 57 def test_externals_single(self): |
55 repo = self._load_fixture_and_fetch('externals.svndump', | 58 repo = self._load_fixture_and_fetch('externals.svndump', |
56 layout='single') | 59 layout='single') |