Changeset - 6c88624c719b
[Not reviewed]
beta
0 2 0
Mads Kiilerich - 13 years ago 2013-03-20 15:00:31
madski@unity3d.com
Transplanted from: 63391519ca46
fork: 'Update after clone' only makes sense if the update hook will maintain it
2 files changed with 11 insertions and 2 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/forks.py
Show inline comments
 
@@ -38,7 +38,8 @@ from rhodecode.lib.auth import LoginRequ
 
    NotAnonymous, HasRepoPermissionAny, HasPermissionAllDecorator,\
 
    HasPermissionAnyDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User
 
from rhodecode.model.db import Repository, RepoGroup, UserFollowing, User,\
 
    RhodeCodeUi
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.model.forms import RepoForkForm
 
from rhodecode.model.scm import ScmModel, GroupList
 
@@ -95,6 +96,8 @@ class ForksController(BaseRepoController
 
            c.stats_percentage = '%.2f' % ((float((last_rev)) /
 
                                            c.repo_last_rev) * 100)
 

	
 
        c.can_update = RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE).ui_active
 

	
 
        defaults = RepoModel()._get_defaults(repo_name)
 
        # alter the description to indicate a fork
 
        defaults['description'] = ('fork of repository: %s \n%s'
 
@@ -159,6 +162,10 @@ class ForksController(BaseRepoController
 
        try:
 
            form_result = _form.to_python(dict(request.POST))
 

	
 
            # an approximation that is better than nothing
 
            if not RhodeCodeUi.get_by_key(RhodeCodeUi.HOOK_UPDATE).ui_active:
 
                form_result['update_after_clone'] = False
 

	
 
            # create fork is done sometimes async on celery, db transaction
 
            # management is handled there.
 
            RepoModel().create_fork(form_result, self.rhodecode_user.user_id)
rhodecode/templates/forks/fork.html
Show inline comments
 
@@ -80,7 +80,8 @@
 
                    ${h.checkbox('copy_permissions',value="True", checked="checked")}
 
                    <span class="help-block">${_('Copy permissions from forked repository')}</span>
 
                </div>
 
             </div>
 
            </div>
 
            %if c.can_update:
 
            <div class="field">
 
                <div class="label label-checkbox">
 
                    <label for="private">${_('Update after clone')}:</label>
 
@@ -90,6 +91,7 @@
 
                    <span class="help-block">${_('Checkout source after making a clone')}</span>
 
                </div>
 
            </div>
 
            %endif
 
            <div class="buttons">
 
                ${h.submit('',_('Fork this repository'),class_="ui-btn large")}
 
            </div>
0 comments (0 inline, 0 general)