Show More
@@ -195,9 +195,12 b' class SettingsController(BaseController)' | |||||
195 | pyramid_settings = get_current_registry().settings |
|
195 | pyramid_settings = get_current_registry().settings | |
196 | c.svn_proxy_generate_config = pyramid_settings[generate_config] |
|
196 | c.svn_proxy_generate_config = pyramid_settings[generate_config] | |
197 |
|
197 | |||
|
198 | defaults = self._form_defaults() | |||
|
199 | ||||
|
200 | model.create_largeobjects_dirs_if_needed(defaults['paths_root_path']) | |||
198 | return htmlfill.render( |
|
201 | return htmlfill.render( | |
199 | render('admin/settings/settings.mako'), |
|
202 | render('admin/settings/settings.mako'), | |
200 |
defaults= |
|
203 | defaults=defaults, | |
201 | encoding="UTF-8", |
|
204 | encoding="UTF-8", | |
202 | force_defaults=False) |
|
205 | force_defaults=False) | |
203 |
|
206 |
@@ -18,6 +18,7 b'' | |||||
18 | # RhodeCode Enterprise Edition, including its added features, Support services, |
|
18 | # RhodeCode Enterprise Edition, including its added features, Support services, | |
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ |
|
19 | # and proprietary license terms, please see https://rhodecode.com/licenses/ | |
20 |
|
20 | |||
|
21 | import os | |||
21 | import hashlib |
|
22 | import hashlib | |
22 | import logging |
|
23 | import logging | |
23 | from collections import namedtuple |
|
24 | from collections import namedtuple | |
@@ -775,3 +776,27 b' class VcsSettingsModel(object):' | |||||
775 | raise ValueError( |
|
776 | raise ValueError( | |
776 | 'The given data does not contain {} key'.format(data_key)) |
|
777 | 'The given data does not contain {} key'.format(data_key)) | |
777 | return data_keys |
|
778 | return data_keys | |
|
779 | ||||
|
780 | def create_largeobjects_dirs_if_needed(self, repo_store_path): | |||
|
781 | """ | |||
|
782 | This is subscribed to the `pyramid.events.ApplicationCreated` event. It | |||
|
783 | does a repository scan if enabled in the settings. | |||
|
784 | """ | |||
|
785 | ||||
|
786 | from rhodecode.lib.vcs.backends.hg import largefiles_store | |||
|
787 | from rhodecode.lib.vcs.backends.git import lfs_store | |||
|
788 | ||||
|
789 | paths = [ | |||
|
790 | largefiles_store(repo_store_path), | |||
|
791 | lfs_store(repo_store_path)] | |||
|
792 | ||||
|
793 | for path in paths: | |||
|
794 | if os.path.isdir(path): | |||
|
795 | continue | |||
|
796 | if os.path.isfile(path): | |||
|
797 | continue | |||
|
798 | # not a file nor dir, we try to create it | |||
|
799 | try: | |||
|
800 | os.makedirs(path) | |||
|
801 | except Exception: | |||
|
802 | log.warning('Failed to create largefiles dir:%s', path) |
General Comments 0
You need to be logged in to leave comments.
Login now