comparison tests/test_single_dir_clone.py @ 1570:d55c9d0ba350

tests: use scmutils.revsymbol instead of repo.__getitem__ for non-integers
author Paul Morelle <paul.morelle@octobus.net>
date Fri, 25 May 2018 11:52:03 +0200
parents a36e87ae2380
children 7bb6562feb85
comparison
equal deleted inserted replaced
1569:4afe8d7e4602 1570:d55c9d0ba350
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 13 from hgsubversion import compathacks
14
15 revsymbol = test_util.revsymbol
14 16
15 class TestSingleDirClone(test_util.TestBase): 17 class TestSingleDirClone(test_util.TestBase):
16 stupid_mode_tests = True 18 stupid_mode_tests = True
17 19
18 def test_clone_single_dir_simple(self): 20 def test_clone_single_dir_simple(self):
34 def test_auto_detect_single(self): 36 def test_auto_detect_single(self):
35 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 37 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
36 layout='auto') 38 layout='auto')
37 self.assertEqual(compathacks.branchset(repo), 39 self.assertEqual(compathacks.branchset(repo),
38 set(['default', 'branch_from_tag'])) 40 set(['default', 'branch_from_tag']))
39 oldmanifest = test_util.filtermanifest(repo['default'].manifest().keys()) 41 oldmanifest = test_util.filtermanifest(revsymbol(repo, 'default').manifest().keys())
40 # remove standard layout 42 # remove standard layout
41 shutil.rmtree(self.wc_path) 43 shutil.rmtree(self.wc_path)
42 # try again with subdir to get single dir clone 44 # try again with subdir to get single dir clone
43 repo = self._load_fixture_and_fetch('branch_from_tag.svndump', 45 repo = self._load_fixture_and_fetch('branch_from_tag.svndump',
44 layout='auto', 46 layout='auto',
45 subdir='trunk') 47 subdir='trunk')
46 self.assertEqual(compathacks.branchset(repo), set(['default', ])) 48 self.assertEqual(compathacks.branchset(repo), set(['default', ]))
47 self.assertEqual(repo['default'].manifest().keys(), oldmanifest) 49 self.assertEqual(revsymbol(repo, 'default').manifest().keys(), oldmanifest)
48 50
49 def test_clone_subdir_is_file_prefix(self): 51 def test_clone_subdir_is_file_prefix(self):
50 FIXTURE = 'subdir_is_file_prefix.svndump' 52 FIXTURE = 'subdir_is_file_prefix.svndump'
51 repo = self._load_fixture_and_fetch(FIXTURE, 53 repo = self._load_fixture_and_fetch(FIXTURE,
52 layout='single', 54 layout='single',