comparison tests/comprehensive/test_stupid_pull.py @ 1367:5ddb35c31097

Merge with stable. This includes the force-disabling of stupid mode on Subversion 1.9 and later.
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 12:52:49 -0500
parents 89997a5fc181
children
comparison
equal deleted inserted replaced
1362:a279eb7185d4 1367:5ddb35c31097
12 except ImportError: 12 except ImportError:
13 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__))) 13 sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
14 import test_util 14 import test_util
15 15
16 from hgsubversion import wrappers 16 from hgsubversion import wrappers
17 from hgsubversion import svnwrap
17 18
18 19
19 def _do_case(self, name, layout): 20 def _do_case(self, name, layout):
20 subdir = test_util.subdir.get(name, '') 21 subdir = test_util.subdir.get(name, '')
21 config = {} 22 config = {}
46 m = lambda self: self._do_case(case, layout) 47 m = lambda self: self._do_case(case, layout)
47 m.__name__ = name 48 m.__name__ = name
48 m.__doc__ = 'Test stupid produces same as real on %s. (%s)' % (case, layout) 49 m.__doc__ = 'Test stupid produces same as real on %s. (%s)' % (case, layout)
49 return m 50 return m
50 51
51 attrs = {'_do_case': _do_case, 52 if svnwrap.subversion_version < (1, 9, 0):
52 } 53 attrs = {'_do_case': _do_case,
53 for case in (f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')): 54 }
54 if case == 'corrupt.svndump': 55 for case in (f for f in os.listdir(test_util.FIXTURES)
55 continue 56 if f.endswith('.svndump')):
56 name = 'test_' + case[:-len('.svndump')].replace('-', '_') 57 if case == 'corrupt.svndump':
57 # Automatic layout branchtag collision exposes a minor defect 58 continue
58 # here, but since it isn't a regression we suppress the test case. 59 name = 'test_' + case[:-len('.svndump')].replace('-', '_')
59 if case != 'branchtagcollision.svndump': 60 # Automatic layout branchtag collision exposes a minor defect
60 attrs[name] = buildmethod(case, name, 'auto') 61 # here, but since it isn't a regression we suppress the test case.
61 attrs[name + '_single'] = buildmethod(case, name + '_single', 'single') 62 if case != 'branchtagcollision.svndump':
62 if case in test_util.custom: 63 attrs[name] = buildmethod(case, name, 'auto')
63 attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom') 64 attrs[name + '_single'] = buildmethod(case, name + '_single', 'single')
65 if case in test_util.custom:
66 attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom')
64 67
65 StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs) 68 StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs)