Show More
@@ -38,7 +38,8 b' from rhodecode.lib.auth import LoginRequ' | |||
|
38 | 38 | NotAnonymous, HasRepoPermissionAny, HasPermissionAllDecorator,\ |
|
39 | 39 | HasPermissionAnyDecorator |
|
40 | 40 | from rhodecode.lib.base import BaseRepoController, render |
|
41 | from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User | |
|
41 | from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User,\ | |
|
42 | RhodeCodeUi | |
|
42 | 43 | from rhodecode.model.repo import RepoModel |
|
43 | 44 | from rhodecode.model.forms import RepoForkForm |
|
44 | 45 | from rhodecode.model.scm import ScmModel, GroupList |
@@ -95,6 +96,8 b' class ForksController(BaseRepoController' | |||
|
95 | 96 | c.stats_percentage = '%.2f' % ((float((last_rev)) / |
|
96 | 97 | c.repo_last_rev) * 100) |
|
97 | 98 | |
|
99 | c.can_update = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE).ui_active | |
|
100 | ||
|
98 | 101 | defaults = RepoModel()._get_defaults(repo_name) |
|
99 | 102 | # alter the description to indicate a fork |
|
100 | 103 | defaults['description'] = ('fork of repository: %s \n%s' |
@@ -159,6 +162,10 b' class ForksController(BaseRepoController' | |||
|
159 | 162 | try: |
|
160 | 163 | form_result = _form.to_python(dict(request.POST)) |
|
161 | 164 | |
|
165 | # an approximation that is better than nothing | |
|
166 | if not RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE).ui_active: | |
|
167 | form_result['update_after_clone'] = False | |
|
168 | ||
|
162 | 169 | # create fork is done sometimes async on celery, db transaction |
|
163 | 170 | # management is handled there. |
|
164 | 171 | RepoModel().create_fork(form_result, self.rhodecode_user.user_id) |
@@ -81,6 +81,7 b'' | |||
|
81 | 81 | <span class="help-block">${_('Copy permissions from forked repository')}</span> |
|
82 | 82 | </div> |
|
83 | 83 |
|
|
84 | %if c.can_update: | |
|
84 | 85 | <div class="field"> |
|
85 | 86 | <div class="label label-checkbox"> |
|
86 | 87 | <label for="private">${_('Update after clone')}:</label> |
@@ -90,6 +91,7 b'' | |||
|
90 | 91 | <span class="help-block">${_('Checkout source after making a clone')}</span> |
|
91 | 92 | </div> |
|
92 | 93 | </div> |
|
94 | %endif | |
|
93 | 95 | <div class="buttons"> |
|
94 | 96 | ${h.submit('',_('Fork this repository'),class_="ui-btn large")} |
|
95 | 97 | </div> |
General Comments 0
You need to be logged in to leave comments.
Login now