##// END OF EJS Templates
mercurial: refactor how we fetch default largefile store....
marcink -
r1562:19b546f8 default
parent child Browse files
Show More
@@ -306,6 +306,7 b' class DbManage(object):'
306 and disables dotencode
306 and disables dotencode
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
310
310 # Build HOOKS
311 # Build HOOKS
311 hooks = [
312 hooks = [
@@ -336,12 +337,12 b' class DbManage(object):'
336 self.sa.add(largefiles)
337 self.sa.add(largefiles)
337
338
338 # set default largefiles cache dir, defaults to
339 # set default largefiles cache dir, defaults to
339 # /repo location/.cache/largefiles
340 # /repo_store_location/.cache/largefiles
340 largefiles = RhodeCodeUi()
341 largefiles = RhodeCodeUi()
341 largefiles.ui_section = 'largefiles'
342 largefiles.ui_section = 'largefiles'
342 largefiles.ui_key = 'usercache'
343 largefiles.ui_key = 'usercache'
343 largefiles.ui_value = os.path.join(repo_store_path, '.cache',
344 largefiles.ui_value = largefiles_store(repo_store_path)
344 'largefiles')
345
345 self.sa.add(largefiles)
346 self.sa.add(largefiles)
346
347
347 # enable hgsubversion disabled by default
348 # enable hgsubversion disabled by default
@@ -21,6 +21,7 b''
21 """
21 """
22 HG module
22 HG module
23 """
23 """
24 import os
24 import logging
25 import logging
25
26
26 from rhodecode.lib.vcs import connection
27 from rhodecode.lib.vcs import connection
@@ -46,3 +47,10 b' def discover_hg_version(raise_on_exc=Fal'
46 if raise_on_exc:
47 if raise_on_exc:
47 raise
48 raise
48 return ''
49 return ''
50
51
52 def largefiles_store(base_location):
53 """
54 Return a largefile store relative to base_location
55 """
56 return os.path.join(base_location, '.cache', 'largefiles')
@@ -92,6 +92,9 b' class DBBackend(object):'
92 def __init__(
92 def __init__(
93 self, config_file, db_name=None, basetemp=None,
93 self, config_file, db_name=None, basetemp=None,
94 connection_string=None):
94 connection_string=None):
95
96 from rhodecode.lib.vcs.backends.hg import largefiles_store
97
95 self.fixture_store = os.path.join(self._store, self._type)
98 self.fixture_store = os.path.join(self._store, self._type)
96 self.db_name = db_name or self._base_db_name
99 self.db_name = db_name or self._base_db_name
97 self._base_ini_file = config_file
100 self._base_ini_file = config_file
@@ -99,6 +102,7 b' class DBBackend(object):'
99 self.stdout = ''
102 self.stdout = ''
100 self._basetemp = basetemp or tempfile.gettempdir()
103 self._basetemp = basetemp or tempfile.gettempdir()
101 self._repos_location = os.path.join(self._basetemp, 'rc_test_repos')
104 self._repos_location = os.path.join(self._basetemp, 'rc_test_repos')
105 self._repos_hg_largefiles_store = largefiles_store(self._basetemp)
102 self.connection_string = connection_string
106 self.connection_string = connection_string
103
107
104 @property
108 @property
@@ -154,6 +158,9 b' class DBBackend(object):'
154 self._type, destroy=True) as _ini_file:
158 self._type, destroy=True) as _ini_file:
155 if not os.path.isdir(self._repos_location):
159 if not os.path.isdir(self._repos_location):
156 os.makedirs(self._repos_location)
160 os.makedirs(self._repos_location)
161 if not os.path.isdir(self._repos_hg_largefiles_store):
162 os.makedirs(self._repos_hg_largefiles_store)
163
157 self.execute(
164 self.execute(
158 "paster setup-rhodecode {0} --user=marcink "
165 "paster setup-rhodecode {0} --user=marcink "
159 "--email=marcin@rhodeocode.com --password={1} "
166 "--email=marcin@rhodeocode.com --password={1} "
General Comments 0
You need to be logged in to leave comments. Login now