##// END OF EJS Templates
vcs-settings: moved creation of largefiles default dirs into vcs settings view....
marcink -
r1682:9db59bee default
parent child Browse files
Show More
@@ -195,9 +195,12 b' class SettingsController(BaseController)'
195 195 pyramid_settings = get_current_registry().settings
196 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 201 return htmlfill.render(
199 202 render('admin/settings/settings.mako'),
200 defaults=self._form_defaults(),
203 defaults=defaults,
201 204 encoding="UTF-8",
202 205 force_defaults=False)
203 206
@@ -18,6 +18,7 b''
18 18 # RhodeCode Enterprise Edition, including its added features, Support services,
19 19 # and proprietary license terms, please see https://rhodecode.com/licenses/
20 20
21 import os
21 22 import hashlib
22 23 import logging
23 24 from collections import namedtuple
@@ -775,3 +776,27 b' class VcsSettingsModel(object):'
775 776 raise ValueError(
776 777 'The given data does not contain {} key'.format(data_key))
777 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