##// 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 create_test_index)
60 create_test_index)
61 from rhodecode.tests import TESTS_TMP_PATH
61 from rhodecode.tests import TESTS_TMP_PATH
62 from rhodecode.lib.vcs.backends.hg import largefiles_store
62 from rhodecode.lib.vcs.backends.hg import largefiles_store
63 from rhodecode.lib.vcs.backends.git import lfs_store
64
63 # test repos
65 # test repos
64 if test_env:
66 if test_env:
65 create_test_directory(TESTS_TMP_PATH)
67 create_test_directory(TESTS_TMP_PATH)
66 # large object stores
68 # large object stores
67 create_test_directory(largefiles_store(TESTS_TMP_PATH))
69 create_test_directory(largefiles_store(TESTS_TMP_PATH))
70 create_test_directory(lfs_store(TESTS_TMP_PATH))
68
71
69 create_test_database(TESTS_TMP_PATH, settings)
72 create_test_database(TESTS_TMP_PATH, settings)
70 create_test_repositories(TESTS_TMP_PATH, settings)
73 create_test_repositories(TESTS_TMP_PATH, settings)
@@ -307,6 +307,7 b' class DbManage(object):'
307 """
307 """
308 settings_model = SettingsModel(sa=self.sa)
308 settings_model = SettingsModel(sa=self.sa)
309 from rhodecode.lib.vcs.backends.hg import largefiles_store
309 from rhodecode.lib.vcs.backends.hg import largefiles_store
310 from rhodecode.lib.vcs.backends.git import lfs_store
310
311
311 # Build HOOKS
312 # Build HOOKS
312 hooks = [
313 hooks = [
@@ -345,6 +346,15 b' class DbManage(object):'
345
346
346 self.sa.add(largefiles)
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 # enable hgsubversion disabled by default
358 # enable hgsubversion disabled by default
349 hgsubversion = RhodeCodeUi()
359 hgsubversion = RhodeCodeUi()
350 hgsubversion.ui_section = 'extensions'
360 hgsubversion.ui_section = 'extensions'
@@ -21,7 +21,7 b''
21 """
21 """
22 GIT module
22 GIT module
23 """
23 """
24
24 import os
25 import logging
25 import logging
26
26
27 from rhodecode.lib.vcs import connection
27 from rhodecode.lib.vcs import connection
@@ -47,3 +47,10 b' def discover_git_version(raise_on_exc=Fa'
47 if raise_on_exc:
47 if raise_on_exc:
48 raise
48 raise
49 return ''
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 connection_string=None):
94 connection_string=None):
95
95
96 from rhodecode.lib.vcs.backends.hg import largefiles_store
96 from rhodecode.lib.vcs.backends.hg import largefiles_store
97 from rhodecode.lib.vcs.backends.git import lfs_store
97
98
98 self.fixture_store = os.path.join(self._store, self._type)
99 self.fixture_store = os.path.join(self._store, self._type)
99 self.db_name = db_name or self._base_db_name
100 self.db_name = db_name or self._base_db_name
@@ -103,6 +104,7 b' class DBBackend(object):'
103 self._basetemp = basetemp or tempfile.gettempdir()
104 self._basetemp = basetemp or tempfile.gettempdir()
104 self._repos_location = os.path.join(self._basetemp, 'rc_test_repos')
105 self._repos_location = os.path.join(self._basetemp, 'rc_test_repos')
105 self._repos_hg_largefiles_store = largefiles_store(self._basetemp)
106 self._repos_hg_largefiles_store = largefiles_store(self._basetemp)
107 self._repos_git_lfs_store = lfs_store(self._basetemp)
106 self.connection_string = connection_string
108 self.connection_string = connection_string
107
109
108 @property
110 @property
@@ -156,10 +158,13 b' class DBBackend(object):'
156 ini_params.extend(self._db_url)
158 ini_params.extend(self._db_url)
157 with TestINI(self._base_ini_file, ini_params,
159 with TestINI(self._base_ini_file, ini_params,
158 self._type, destroy=True) as _ini_file:
160 self._type, destroy=True) as _ini_file:
161
159 if not os.path.isdir(self._repos_location):
162 if not os.path.isdir(self._repos_location):
160 os.makedirs(self._repos_location)
163 os.makedirs(self._repos_location)
161 if not os.path.isdir(self._repos_hg_largefiles_store):
164 if not os.path.isdir(self._repos_hg_largefiles_store):
162 os.makedirs(self._repos_hg_largefiles_store)
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 self.execute(
169 self.execute(
165 "paster setup-rhodecode {0} --user=marcink "
170 "paster setup-rhodecode {0} --user=marcink "
General Comments 0
You need to be logged in to leave comments. Login now