# HG changeset patch # User Marcin Kuzminski # Date 2017-05-10 07:50:24 # Node ID 698b4f9af925dc49ee24eb03f4398391c23d7169 # Parent a2c26a724a5de152a777e339de08ecdf9c86ed46 svn: increase possibility to specify compatability to 1.9. - now possible to spec pre-1.9-compat. diff --git a/vcsserver/svn.py b/vcsserver/svn.py --- a/vcsserver/svn.py +++ b/vcsserver/svn.py @@ -47,8 +47,17 @@ svn_compatible_versions = set([ 'pre-1.5-compatible', 'pre-1.6-compatible', 'pre-1.8-compatible', + 'pre-1.9-compatible', ]) +svn_compatible_versions_map = { + 'pre-1.4-compatible': '1.3', + 'pre-1.5-compatible': '1.4', + 'pre-1.6-compatible': '1.5', + 'pre-1.8-compatible': '1.7', + 'pre-1.9-compatible': '1.8', +} + def reraise_safe_exceptions(func): """Decorator for converting svn exceptions to something neutral.""" @@ -68,14 +77,15 @@ class SubversionFactory(RepoFactory): def _create_repo(self, wire, create, compatible_version): path = svn.core.svn_path_canonicalize(wire['path']) if create: - fs_config = {} + fs_config = {'compatible-version': '1.9'} if compatible_version: if compatible_version not in svn_compatible_versions: raise Exception('Unknown SVN compatible version "{}"' .format(compatible_version)) - log.debug('Create SVN repo with compatible version "%s"', - compatible_version) - fs_config[compatible_version] = '1' + fs_config['compatible-version'] = \ + svn_compatible_versions_map[compatible_version] + + log.debug('Create SVN repo with config "%s"', fs_config) repo = svn.repos.create(path, "", "", None, fs_config) else: repo = svn.repos.open(path) @@ -88,7 +98,6 @@ class SubversionFactory(RepoFactory): return self._repo(wire, create_new_repo) - NODE_TYPE_MAPPING = { svn.core.svn_node_file: 'file', svn.core.svn_node_dir: 'dir',