# HG changeset patch # User Augie Fackler # Date 1451584369 18000 # Node ID 5ddb35c310975392bbd1a0fdce7e03b362c5dfbb # Parent a279eb7185d4815781293ecfd31cb1e0cdbbc836# Parent 388511fe46be95f37cc209812c09d9f661aaeb8e Merge with stable. This includes the force-disabling of stupid mode on Subversion 1.9 and later. diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -18,3 +18,4 @@ c1756971f8828a59c859513f208c6d79bf34c275 dde1ade36a49d3d0e1b4b8bd384a6797665b5081 1.8.1 38be7a6b6def3298fe9ffff141eb58e1370a53cc 1.8.2 759cafce6becef077fb1a152b554a05ff66b04cd 1.8.3 +89997a5fc18163c5f65b83272b4521cdbf29984e 1.8.4 diff --git a/hgsubversion/stupid.py b/hgsubversion/stupid.py --- a/hgsubversion/stupid.py +++ b/hgsubversion/stupid.py @@ -630,6 +630,11 @@ def branches_in_paths(meta, tbdelta, pat return branches def convert_rev(ui, meta, svn, r, tbdelta, firstrun): + if svnwrap.subversion_version >= (1, 9, 0): + raise hgutil.Abort( + "hgsubversion doesn't support stupid mode with Subversion 1.9." + ' Please email hgsubversion@googlegroups.com and let us know you' + ' saw this, otherwise we may remove stupid mode entirely.') # this server fails at replay if meta.filemap: diff --git a/hgsubversion/svnwrap/svn_swig_wrapper.py b/hgsubversion/svnwrap/svn_swig_wrapper.py --- a/hgsubversion/svnwrap/svn_swig_wrapper.py +++ b/hgsubversion/svnwrap/svn_swig_wrapper.py @@ -22,19 +22,19 @@ try: from svn import delta from svn import ra - current_bindings = (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, - core.SVN_VER_MICRO) + subversion_version = (core.SVN_VER_MAJOR, core.SVN_VER_MINOR, + core.SVN_VER_MICRO) except ImportError: raise ImportError('Subversion %d.%d.%d or later required, ' 'but no bindings were found' % required_bindings) -if current_bindings < required_bindings: # pragma: no cover +if subversion_version < required_bindings: # pragma: no cover raise ImportError('Subversion %d.%d.%d or later required, ' 'but bindings for %d.%d.%d found' % - (required_bindings + current_bindings)) + (required_bindings + subversion_version)) def version(): - return '%d.%d.%d' % current_bindings, 'SWIG' + return '%d.%d.%d' % subversion_version, 'SWIG' # exported values ERR_FS_ALREADY_EXISTS = core.SVN_ERR_FS_ALREADY_EXISTS diff --git a/tests/comprehensive/test_custom_layout.py b/tests/comprehensive/test_custom_layout.py --- a/tests/comprehensive/test_custom_layout.py +++ b/tests/comprehensive/test_custom_layout.py @@ -14,6 +14,7 @@ except ImportError: import test_util from hgsubversion import wrappers +from hgsubversion import svnwrap def _do_case(self, name, stupid): @@ -55,7 +56,8 @@ attrs = {'_do_case': _do_case, for case in test_util.custom: name = 'test_' + case[:-len('.svndump')].replace('-', '_') attrs[name] = buildmethod(case, name, stupid=False) - name += '_stupid' - attrs[name] = buildmethod(case, name, stupid=True) + if svnwrap.subversion_version < (1, 9, 0): + name += '_stupid' + attrs[name] = buildmethod(case, name, stupid=True) CustomPullTests = type('CustomPullTests', (test_util.TestBase,), attrs) diff --git a/tests/comprehensive/test_stupid_pull.py b/tests/comprehensive/test_stupid_pull.py --- a/tests/comprehensive/test_stupid_pull.py +++ b/tests/comprehensive/test_stupid_pull.py @@ -14,6 +14,7 @@ except ImportError: import test_util from hgsubversion import wrappers +from hgsubversion import svnwrap def _do_case(self, name, layout): @@ -48,18 +49,20 @@ def buildmethod(case, name, layout): m.__doc__ = 'Test stupid produces same as real on %s. (%s)' % (case, layout) return m -attrs = {'_do_case': _do_case, - } -for case in (f for f in os.listdir(test_util.FIXTURES) if f.endswith('.svndump')): - if case == 'corrupt.svndump': - continue - name = 'test_' + case[:-len('.svndump')].replace('-', '_') - # Automatic layout branchtag collision exposes a minor defect - # here, but since it isn't a regression we suppress the test case. - if case != 'branchtagcollision.svndump': - attrs[name] = buildmethod(case, name, 'auto') - attrs[name + '_single'] = buildmethod(case, name + '_single', 'single') - if case in test_util.custom: - attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom') +if svnwrap.subversion_version < (1, 9, 0): + attrs = {'_do_case': _do_case, + } + for case in (f for f in os.listdir(test_util.FIXTURES) + if f.endswith('.svndump')): + if case == 'corrupt.svndump': + continue + name = 'test_' + case[:-len('.svndump')].replace('-', '_') + # Automatic layout branchtag collision exposes a minor defect + # here, but since it isn't a regression we suppress the test case. + if case != 'branchtagcollision.svndump': + attrs[name] = buildmethod(case, name, 'auto') + attrs[name + '_single'] = buildmethod(case, name + '_single', 'single') + if case in test_util.custom: + attrs[name + '_custom'] = buildmethod(case, name + '_custom', 'custom') -StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs) + StupidPullTests = type('StupidPullTests', (test_util.TestBase,), attrs) diff --git a/tests/test_util.py b/tests/test_util.py --- a/tests/test_util.py +++ b/tests/test_util.py @@ -28,6 +28,7 @@ from mercurial import util as hgutil from mercurial import extensions from hgsubversion import compathacks +from hgsubversion import svnwrap try: from mercurial import obsolete @@ -358,8 +359,12 @@ def svnpropget(repo_path, path, prop, re stdout=subprocess.PIPE, stderr=subprocess.STDOUT) stdout, stderr = p.communicate() - if p.returncode: + if p.returncode and stderr: raise Exception('svn ls failed on %s: %r' % (path, stderr)) + if 'W200017' in stdout: + # subversion >= 1.9 changed 'no properties' to be an error, so let's + # avoid that + return '' return stdout.strip() @@ -431,7 +436,7 @@ class TestMeta(type): for origname in dir(cls): _obsolete_wrap(cls, origname) - if cls.stupid_mode_tests: + if cls.stupid_mode_tests and svnwrap.subversion_version < (1, 9, 0): for origname in dir(cls): _stupid_wrap(cls, origname) @@ -761,7 +766,11 @@ files: {files} """ _ui.pushbuffer() - graphlog.graphlog(_ui, repo, rev=None, template=templ) + try: + graphlog.graphlog(_ui, repo, rev=None, template=templ) + except AttributeError: + from mercurial import commands + commands.log(_ui, repo, rev=None, template=templ, graph=True) return _ui.popbuffer() def draw(self, repo):