comparison tests/comprehensive/test_stupid_pull.py @ 1365:89997a5fc181 stable 1.8.4

stupid: self-disable if svn bindings are too new to work with stupid mode Subversion 1.9 enhanced the diff format slightly in a way that we can't parse. We're collectively weary in hgsubversion of parsing diffs to emulate replay given that ra_replay was new in Subversion 1.5, which is now 7.5 years old. Rather than try to adapt to the diff format changes, we'll disable stupid mode for 1.9 bindings and see if anyone actually bothers to email the list and tell us they saw the message. I figure if we don't see anything by mid 2016 or so we can rip out stupid mode entirely. Disable all tests that use stupid mode when 1.9 is in play. This should actually be a nice runtime win on the testsuite since we'll be running many hundreds fewer tests overall.
author Augie Fackler <raf@durin42.com>
date Thu, 31 Dec 2015 12:06:58 -0500
parents c6b01fd34694
children
comparison
equal deleted inserted replaced
1364:460332aafe7d 1365:89997a5fc181
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)