##// END OF EJS Templates
git-lfs: create default LFS storage on new installation...
marcink -
r1564:41524466 default
parent child Browse files
Show More
@@ -60,11 +60,14 b' def initialize_test_environment(settings'
60 60 create_test_index)
61 61 from rhodecode.tests import TESTS_TMP_PATH
62 62 from rhodecode.lib.vcs.backends.hg import largefiles_store
63 from rhodecode.lib.vcs.backends.git import lfs_store
64
63 65 # test repos
64 66 if test_env:
65 67 create_test_directory(TESTS_TMP_PATH)
66 68 # large object stores
67 69 create_test_directory(largefiles_store(TESTS_TMP_PATH))
70 create_test_directory(lfs_store(TESTS_TMP_PATH))
68 71
69 72 create_test_database(TESTS_TMP_PATH, settings)
70 73 create_test_repositories(TESTS_TMP_PATH, settings)
@@ -307,6 +307,7 b' class DbManage(object):'
307 307 """
308 308 settings_model = SettingsModel(sa=self.sa)
309 309 from rhodecode.lib.vcs.backends.hg import largefiles_store
310 from rhodecode.lib.vcs.backends.git import lfs_store
310 311
311 312 # Build HOOKS
312 313 hooks = [
@@ -345,6 +346,15 b' class DbManage(object):'
345 346
346 347 self.sa.add(largefiles)
347 348
349 # set default lfs cache dir, defaults to
350 # /repo_store_location/.cache/lfs_store
351 lfsstore = RhodeCodeUi()
352 lfsstore.ui_section = 'vcs_git_lfs'
353 lfsstore.ui_key = 'store_location'
354 lfsstore.ui_value = lfs_store(repo_store_path)
355
356 self.sa.add(lfsstore)
357
348 358 # enable hgsubversion disabled by default
349 359 hgsubversion = RhodeCodeUi()
350 360 hgsubversion.ui_section = 'extensions'
@@ -21,7 +21,7 b''
21 21 """
22 22 GIT module
23 23 """
24
24 import os
25 25 import logging
26 26
27 27 from rhodecode.lib.vcs import connection
@@ -47,3 +47,10 b' def discover_git_version(raise_on_exc=Fa'
47 47 if raise_on_exc:
48 48 raise
49 49 return ''
50
51
52 def lfs_store(base_location):
53 """
54 Return a lfs store relative to base_location
55 """
56 return os.path.join(base_location, '.cache', 'lfs_store')
@@ -94,6 +94,7 b' class DBBackend(object):'
94 94 connection_string=None):
95 95
96 96 from rhodecode.lib.vcs.backends.hg import largefiles_store
97 from rhodecode.lib.vcs.backends.git import lfs_store
97 98
98 99 self.fixture_store = os.path.join(self._store, self._type)
99 100 self.db_name = db_name or self._base_db_name
@@ -103,6 +104,7 b' class DBBackend(object):'
103 104 self._basetemp = basetemp or tempfile.gettempdir()
104 105 self._repos_location = os.path.join(self._basetemp, 'rc_test_repos')
105 106 self._repos_hg_largefiles_store = largefiles_store(self._basetemp)
107 self._repos_git_lfs_store = lfs_store(self._basetemp)
106 108 self.connection_string = connection_string
107 109
108 110 @property
@@ -156,10 +158,13 b' class DBBackend(object):'
156 158 ini_params.extend(self._db_url)
157 159 with TestINI(self._base_ini_file, ini_params,
158 160 self._type, destroy=True) as _ini_file:
161
159 162 if not os.path.isdir(self._repos_location):
160 163 os.makedirs(self._repos_location)
161 164 if not os.path.isdir(self._repos_hg_largefiles_store):
162 165 os.makedirs(self._repos_hg_largefiles_store)
166 if not os.path.isdir(self._repos_git_lfs_store):
167 os.makedirs(self._repos_git_lfs_store)
163 168
164 169 self.execute(
165 170 "paster setup-rhodecode {0} --user=marcink "
General Comments 0
You need to be logged in to leave comments. Login now