comparison tests/test_single_dir_clone.py @ 1599:7bb6562feb85

compathacks: drop branchset() which is compat code for hg<2.9
author Pulkit Goyal <pulkit@yandex-team.ru>
date Tue, 27 Nov 2018 14:08:11 +0300
parents d55c9d0ba350
children
comparison
equal deleted inserted replaced
1598:394007c5efea 1599:7bb6562feb85
19 19
20 def test_clone_single_dir_simple(self): 20 def test_clone_single_dir_simple(self):
21 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 21 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
22 layout='single', 22 layout='single',
23 subdir='') 23 subdir='')
24 self.assertEqual(compathacks.branchset(repo), 24 self.assertEqual(set(repo.branchmap()),
25 set(['default'])) 25 set(['default']))
26 self.assertEqual(sorted(repo['tip'].manifest().keys()), 26 self.assertEqual(sorted(repo['tip'].manifest().keys()),
27 ['branches/branch_from_tag/alpha', 27 ['branches/branch_from_tag/alpha',
28 'branches/branch_from_tag/beta', 28 'branches/branch_from_tag/beta',
29 'tags/copied_tag/alpha', 29 'tags/copied_tag/alpha',
34 'trunk/beta']) 34 'trunk/beta'])
35 35
36 def test_auto_detect_single(self): 36 def test_auto_detect_single(self):
37 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 37 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
38 layout='auto') 38 layout='auto')
39 self.assertEqual(compathacks.branchset(repo), 39 self.assertEqual(set(repo.branchmap()),
40 set(['default', 'branch_from_tag'])) 40 set(['default', 'branch_from_tag']))
41 oldmanifest = test_util.filtermanifest(revsymbol(repo, 'default').manifest().keys()) 41 oldmanifest = test_util.filtermanifest(revsymbol(repo, 'default').manifest().keys())
42 # remove standard layout 42 # remove standard layout
43 shutil.rmtree(self.wc_path) 43 shutil.rmtree(self.wc_path)
44 # try again with subdir to get single dir clone 44 # try again with subdir to get single dir clone
45 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 45 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
46 layout='auto', 46 layout='auto',
47 subdir='trunk') 47 subdir='trunk')
48 self.assertEqual(compathacks.branchset(repo), set(['default', ])) 48 self.assertEqual(set(repo.branchmap()), set(['default', ]))
49 self.assertEqual(revsymbol(repo, 'default').manifest().keys(), oldmanifest) 49 self.assertEqual(revsymbol(repo, 'default').manifest().keys(), oldmanifest)
50 50
51 def test_clone_subdir_is_file_prefix(self): 51 def test_clone_subdir_is_file_prefix(self):
52 FIXTURE = 'subdir_is_file_prefix.svndump' 52 FIXTURE = 'subdir_is_file_prefix.svndump'
53 repo = self._load_fixture_and_fetch(FIXTURE, 53 repo = self._load_fixture_and_fetch(FIXTURE,
54 layout='single', 54 layout='single',
55 subdir=test_util.subdir[FIXTURE]) 55 subdir=test_util.subdir[FIXTURE])
56 self.assertEqual(compathacks.branchset(repo), set(['default'])) 56 self.assertEqual(set(repo.branchmap()), set(['default']))
57 self.assertEqual(repo['tip'].manifest().keys(), ['flaf.txt']) 57 self.assertEqual(repo['tip'].manifest().keys(), ['flaf.txt'])
58 58
59 def test_externals_single(self): 59 def test_externals_single(self):
60 repo = self._load_fixture_and_fetch('externals.svndump', 60 repo = self._load_fixture_and_fetch('externals.svndump',
61 layout='single') 61 layout='single')