comparison tests/comprehensive/test_verify_and_startrev.py @ 1092:cd0d14e25757

layouts: add custom layout for those of us that need weird mappings This adds a config-driven custom layout, targeted at the case where you need to fetch a small subset of a large number of subversion branches, or where your subversion layout doesn't match the standard trunk/branches/tags layout very well.
author David Schleimer <dschleimer@fb.com>
date Mon, 26 Aug 2013 16:40:31 -0700
parents cd256960b622
children ff4e102932ed
comparison
equal deleted inserted replaced
1091:384eb7e05b61 1092:cd0d14e25757
37 'emptyrepo2.svndump', 37 'emptyrepo2.svndump',
38 ]) 38 ])
39 39
40 def _do_case(self, name, layout): 40 def _do_case(self, name, layout):
41 subdir = test_util.subdir.get(name, '') 41 subdir = test_util.subdir.get(name, '')
42 repo, svnpath = self.load_and_fetch(name, subdir=subdir, layout=layout) 42 config = {}
43 for branch, path in test_util.custom.get(name, {}).iteritems():
44 config['hgsubversionbranch.%s' % branch] = path
45 repo, svnpath = self.load_and_fetch(name,
46 subdir=subdir,
47 layout=layout,
48 config=config)
43 assert test_util.repolen(self.repo) > 0 49 assert test_util.repolen(self.repo) > 0
44 for i in repo: 50 for i in repo:
45 ctx = repo[i] 51 ctx = repo[i]
46 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(), 52 self.assertEqual(verify.verify(repo.ui, repo, rev=ctx.node(),
47 stupid=True), 0) 53 stupid=True), 0)
96 if case in _skipall: 102 if case in _skipall:
97 continue 103 continue
98 bname = 'test_' + case[:-len('.svndump')] 104 bname = 'test_' + case[:-len('.svndump')]
99 if case not in _skipstandard: 105 if case not in _skipstandard:
100 attrs[bname] = buildmethod(case, bname, 'standard') 106 attrs[bname] = buildmethod(case, bname, 'standard')
101 name = bname + '_single' 107 attrs[bname + '_single'] = buildmethod(case, bname + '_single', 'single')
102 attrs[name] = buildmethod(case, name, 'single') 108 if case in test_util.custom:
109 attrs[bname + '_custom'] = buildmethod(case, bname + '_custom', 'custom')
103 110
104 VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs) 111 VerifyTests = type('VerifyTests', (test_util.TestBase,), attrs)