##// END OF EJS Templates
svn: Move path computation from themplate to python.
Martin Bornhold -
r570:bb5e4c7c default
parent child Browse files
Show More
@@ -46,8 +46,9 b''
46 Order allow,deny
46 Order allow,deny
47 </Location>
47 </Location>
48
48
49 % for repo_group in repo_groups:
49 % for location, parent_path in repo_group_paths:
50 <Location ${location_root_stripped}${repo_group.full_path}>
50
51 <Location ${location}>
51 AuthType Basic
52 AuthType Basic
52 AuthName "Subversion proxy"
53 AuthName "Subversion proxy"
53 AuthBasicProvider anon
54 AuthBasicProvider anon
@@ -55,7 +56,7 b''
55 Require valid-user
56 Require valid-user
56
57
57 DAV svn
58 DAV svn
58 SVNParentPath ${parent_path_root_stripped}${repo_group.full_path}
59 SVNParentPath ${parent_path}
59 SVNListParentPath ${'On' if svn_list_parent_path else 'Off'}
60 SVNListParentPath ${'On' if svn_list_parent_path else 'Off'}
60
61
61 Allow from all
62 Allow from all
@@ -38,16 +38,23 b' def generate_mod_dav_svn_config(settings'
38 list_parent_path = settings[config_keys.list_parent_path]
38 list_parent_path = settings[config_keys.list_parent_path]
39 location_root = settings[config_keys.location_root]
39 location_root = settings[config_keys.location_root]
40
40
41 # Render the configuration to string.
41 # Prepare render context.
42 template = 'rhodecode:svn_support/templates/mod-dav-svn.conf.mako'
42 repo_group_paths = []
43 for repo_group in RepoGroup.get_all_repo_groups():
44 group_path = repo_group.full_path_splitted
45 location = os.path.join(location_root, *group_path)
46 parent_path = os.path.join(parent_path_root, *group_path)
47 repo_group_paths.append((location, parent_path))
48
43 context = {
49 context = {
44 'location_root': location_root,
50 'location_root': location_root,
45 'location_root_stripped': location_root.rstrip(os.path.sep),
46 'parent_path_root': parent_path_root,
51 'parent_path_root': parent_path_root,
47 'parent_path_root_stripped': parent_path_root.rstrip(os.path.sep),
52 'repo_group_paths': repo_group_paths,
48 'repo_groups': RepoGroup.get_all_repo_groups(),
49 'svn_list_parent_path': list_parent_path,
53 'svn_list_parent_path': list_parent_path,
50 }
54 }
55
56 # Render the configuration template to string.
57 template = 'rhodecode:svn_support/templates/mod-dav-svn.conf.mako'
51 mod_dav_svn_config = render(template, context)
58 mod_dav_svn_config = render(template, context)
52
59
53 # Write configuration to file.
60 # Write configuration to file.
General Comments 0
You need to be logged in to leave comments. Login now