##// END OF EJS Templates
svn: allow to specify any svn compatible version string not only hardcoded values....
ergo -
r844:c77576f0 default
parent child Browse files
Show More
@@ -41,16 +41,6 b' from vcsserver.vcs_base import RemoteBas'
41 log = logging.getLogger(__name__)
41 log = logging.getLogger(__name__)
42
42
43
43
44 # Set of svn compatible version flags.
45 # Compare with subversion/svnadmin/svnadmin.c
46 svn_compatible_versions = {
47 'pre-1.4-compatible',
48 'pre-1.5-compatible',
49 'pre-1.6-compatible',
50 'pre-1.8-compatible',
51 'pre-1.9-compatible'
52 }
53
54 svn_compatible_versions_map = {
44 svn_compatible_versions_map = {
55 'pre-1.4-compatible': '1.3',
45 'pre-1.4-compatible': '1.3',
56 'pre-1.5-compatible': '1.4',
46 'pre-1.5-compatible': '1.4',
@@ -59,6 +49,8 b' svn_compatible_versions_map = {'
59 'pre-1.9-compatible': '1.8',
49 'pre-1.9-compatible': '1.8',
60 }
50 }
61
51
52 current_compatible_version = '1.12'
53
62
54
63 def reraise_safe_exceptions(func):
55 def reraise_safe_exceptions(func):
64 """Decorator for converting svn exceptions to something neutral."""
56 """Decorator for converting svn exceptions to something neutral."""
@@ -79,13 +71,13 b' class SubversionFactory(RepoFactory):'
79 def _create_repo(self, wire, create, compatible_version):
71 def _create_repo(self, wire, create, compatible_version):
80 path = svn.core.svn_path_canonicalize(wire['path'])
72 path = svn.core.svn_path_canonicalize(wire['path'])
81 if create:
73 if create:
82 fs_config = {'compatible-version': '1.9'}
74 fs_config = {'compatible-version': current_compatible_version}
83 if compatible_version:
75 if compatible_version:
84 if compatible_version not in svn_compatible_versions:
76
85 raise Exception('Unknown SVN compatible version "{}"'
77 compatible_version_string = \
86 .format(compatible_version))
78 svn_compatible_versions_map.get(compatible_version) \
87 fs_config['compatible-version'] = \
79 or compatible_version
88 svn_compatible_versions_map[compatible_version]
80 fs_config['compatible-version'] = compatible_version_string
89
81
90 log.debug('Create SVN repo with config "%s"', fs_config)
82 log.debug('Create SVN repo with config "%s"', fs_config)
91 repo = svn.repos.create(path, "", "", None, fs_config)
83 repo = svn.repos.create(path, "", "", None, fs_config)
General Comments 0
You need to be logged in to leave comments. Login now