Show More
@@ -7,26 +7,8 b' Change the |hg| Large Files Location' | |||
|
7 | 7 | :file:`/home/{user}/repos/.cache/largefiles`. If you wish to change this, use |
|
8 | 8 | the following steps: |
|
9 | 9 | |
|
10 | 1. Open ishell from the terminal and use it to log into the |RCE| database by | |
|
11 | specifying the instance :file:`rhodecode.ini` file. | |
|
12 | ||
|
13 | .. code-block:: bash | |
|
14 | ||
|
15 | # Open iShell from the terminal and set ini file | |
|
16 | $ rccontrol ishell enterprise-1 | |
|
17 | ||
|
18 | 2. Run the following commands, and ensure that |RCE| has write access to the | |
|
19 | new directory: | |
|
10 | 1. Open :menuselection:`Admin --> Settings --> VCS` as super-admin. | |
|
20 | 11 | |
|
21 | .. code-block:: bash | |
|
12 | In section called `Mercurial Settings` you can change where the largefiles | |
|
13 | objects should be stored. | |
|
22 | 14 | |
|
23 | # Once logged into the database, use SQL to redirect | |
|
24 | # the large files location | |
|
25 | In [1]: from rhodecode.model.settings import SettingsModel | |
|
26 | In [2]: SettingsModel().get_ui_by_key('usercache') | |
|
27 | Out[2]: <RhodeCodeUi[largefiles]usercache=>/mnt/hgfs/shared/workspace/xxxx/.cache/largefiles]> | |
|
28 | ||
|
29 | In [3]: largefiles_cache = SettingsModel().get_ui_by_key('usercache') | |
|
30 | In [4]: largefiles_cache.ui_value = '/new/path’ | |
|
31 | In [5]: Session().add(largefiles_cache);Session().commit() | |
|
32 |
@@ -59,9 +59,13 b' def initialize_test_environment(settings' | |||
|
59 | 59 | create_test_directory, create_test_database, create_test_repositories, |
|
60 | 60 | create_test_index) |
|
61 | 61 | from rhodecode.tests import TESTS_TMP_PATH |
|
62 | from rhodecode.lib.vcs.backends.hg import largefiles_store | |
|
62 | 63 | # test repos |
|
63 | 64 | if test_env: |
|
64 | 65 | create_test_directory(TESTS_TMP_PATH) |
|
66 | # large object stores | |
|
67 | create_test_directory(largefiles_store(TESTS_TMP_PATH)) | |
|
68 | ||
|
65 | 69 | create_test_database(TESTS_TMP_PATH, settings) |
|
66 | 70 | create_test_repositories(TESTS_TMP_PATH, settings) |
|
67 | 71 | create_test_index(TESTS_TMP_PATH, settings) |
@@ -396,6 +396,10 b' def ApplicationUiSettingsForm():' | |||
|
396 | 396 | v.ValidPath(), |
|
397 | 397 | v.UnicodeString(strip=True, min=1, not_empty=True) |
|
398 | 398 | ) |
|
399 | largefiles_usercache = All( | |
|
400 | v.ValidPath(), | |
|
401 | v.UnicodeString(strip=True, min=2, not_empty=True) | |
|
402 | ) | |
|
399 | 403 | extensions_hgsubversion = v.StringBoolean(if_missing=False) |
|
400 | 404 | extensions_hggit = v.StringBoolean(if_missing=False) |
|
401 | 405 | new_svn_branch = v.ValidSvnPattern(section='vcs_svn_branch') |
@@ -416,6 +416,7 b' class VcsSettingsModel(object):' | |||
|
416 | 416 | ('phases', 'publish')) |
|
417 | 417 | GLOBAL_HG_SETTINGS = ( |
|
418 | 418 | ('extensions', 'largefiles'), |
|
419 | ('largefiles', 'usercache'), | |
|
419 | 420 | ('phases', 'publish'), |
|
420 | 421 | ('extensions', 'hgsubversion')) |
|
421 | 422 | GLOBAL_SVN_SETTINGS = ( |
@@ -543,13 +544,18 b' class VcsSettingsModel(object):' | |||
|
543 | 544 | self.repo_settings, *phases, value=safe_str(data[phases_key])) |
|
544 | 545 | |
|
545 | 546 | def create_or_update_global_hg_settings(self, data): |
|
546 |
largefiles, phases, hgsubversion |
|
|
547 | largefiles_key, phases_key, subversion_key = self._get_settings_keys( | |
|
548 | self.GLOBAL_HG_SETTINGS, data) | |
|
547 | largefiles, largefiles_store, phases, hgsubversion \ | |
|
548 | = self.GLOBAL_HG_SETTINGS | |
|
549 | largefiles_key, largefiles_store_key, phases_key, subversion_key \ | |
|
550 | = self._get_settings_keys(self.GLOBAL_HG_SETTINGS, data) | |
|
551 | ||
|
549 | 552 | self._create_or_update_ui( |
|
550 | 553 | self.global_settings, *largefiles, value='', |
|
551 | 554 | active=data[largefiles_key]) |
|
552 | 555 | self._create_or_update_ui( |
|
556 | self.global_settings, *largefiles_store, | |
|
557 | value=data[largefiles_store_key]) | |
|
558 | self._create_or_update_ui( | |
|
553 | 559 | self.global_settings, *phases, value=safe_str(data[phases_key])) |
|
554 | 560 | self._create_or_update_ui( |
|
555 | 561 | self.global_settings, *hgsubversion, active=data[subversion_key]) |
@@ -96,8 +96,24 b'' | |||
|
96 | 96 | <label for="extensions_largefiles${suffix}">${_('Enable largefiles extension')}</label> |
|
97 | 97 | </div> |
|
98 | 98 | <div class="label"> |
|
99 | % if display_globals: | |
|
99 | 100 | <span class="help-block">${_('Enable Largefiles extensions for all repositories.')}</span> |
|
101 | % else: | |
|
102 | <span class="help-block">${_('Enable Largefiles extensions for this repository.')}</span> | |
|
103 | % endif | |
|
100 | 104 | </div> |
|
105 | ||
|
106 | % if display_globals: | |
|
107 | <div class="field"> | |
|
108 | <div class="input"> | |
|
109 | ${h.text('largefiles_usercache' + suffix, size=59)} | |
|
110 | </div> | |
|
111 | </div> | |
|
112 | <div class="label"> | |
|
113 | <span class="help-block">${_('Filesystem location where Mercurial largefile objects should be stored.')}</span> | |
|
114 | </div> | |
|
115 | % endif | |
|
116 | ||
|
101 | 117 | <div class="checkbox"> |
|
102 | 118 | ${h.checkbox('phases_publish' + suffix, 'True', **kwargs)} |
|
103 | 119 | <label for="phases_publish${suffix}">${_('Set repositories as publishing') if display_globals else _('Set repository as publishing')}</label> |
@@ -566,6 +566,7 b' class TestUpdateGlobalPathSetting(object' | |||
|
566 | 566 | class TestCreateOrUpdateGlobalHgSettings(object): |
|
567 | 567 | FORM_DATA = { |
|
568 | 568 | 'extensions_largefiles': False, |
|
569 | 'largefiles_usercache': '/example/largefiles-store', | |
|
569 | 570 | 'phases_publish': False, |
|
570 | 571 | 'extensions_hgsubversion': False |
|
571 | 572 | } |
@@ -577,6 +578,8 b' class TestCreateOrUpdateGlobalHgSettings' | |||
|
577 | 578 | expected_calls = [ |
|
578 | 579 | mock.call(model.global_settings, 'extensions', 'largefiles', |
|
579 | 580 | active=False, value=''), |
|
581 | mock.call(model.global_settings, 'largefiles', 'usercache', | |
|
582 | value='/example/largefiles-store'), | |
|
580 | 583 | mock.call(model.global_settings, 'phases', 'publish', |
|
581 | 584 | value='False'), |
|
582 | 585 | mock.call(model.global_settings, 'extensions', 'hgsubversion', |
@@ -638,6 +641,7 b' class TestFilterUiSettings(object):' | |||
|
638 | 641 | 'test_tag', True), |
|
639 | 642 | ] |
|
640 | 643 | non_repo_settings = [ |
|
644 | UiSetting('largefiles', 'usercache', '/example/largefiles-store', True), | |
|
641 | 645 | UiSetting('test', 'outgoing.pull_logger', 'hook', True), |
|
642 | 646 | UiSetting('hooks', 'test2', 'hook', True), |
|
643 | 647 | UiSetting( |
@@ -928,6 +932,7 b' class TestCreateOrUpdateRepoSettings(obj' | |||
|
928 | 932 | 'hooks_changegroup_push_logger': False, |
|
929 | 933 | 'hooks_outgoing_pull_logger': False, |
|
930 | 934 | 'extensions_largefiles': False, |
|
935 | 'largefiles_usercache': '/example/largefiles-store', | |
|
931 | 936 | 'phases_publish': 'false', |
|
932 | 937 | 'rhodecode_pr_merge_enabled': False, |
|
933 | 938 | 'rhodecode_use_outdated_comments': False, |
General Comments 0
You need to be logged in to leave comments.
Login now