changeset 1742:40c4f7351574 beta

added option to do a checkout after cloning a repository
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 30 Nov 2011 23:11:30 +0200
parents fcbc35ecb024
children db4852ed3413
files rhodecode/lib/celerylib/tasks.py rhodecode/model/forms.py rhodecode/templates/forks/fork.html
diffstat 3 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/celerylib/tasks.py	Tue Nov 29 09:55:30 2011 +0200
+++ b/rhodecode/lib/celerylib/tasks.py	Wed Nov 30 23:11:30 2011 +0200
@@ -372,6 +372,7 @@
     alias = form_data['repo_type']
     org_repo_name = form_data['org_path']
     fork_name = form_data['repo_name_full']
+    update_after_clone = form_data['update_after_clone']
     source_repo_path = os.path.join(base_path, org_repo_name)
     destination_fork_path = os.path.join(base_path, fork_name)
 
@@ -379,7 +380,8 @@
              destination_fork_path)
     backend = get_backend(alias)
     backend(safe_str(destination_fork_path), create=True,
-            src_url=safe_str(source_repo_path))
+            src_url=safe_str(source_repo_path),
+            update_after_clone=update_after_clone)
     action_logger(cur_user, 'user_forked_repo:%s' % fork_name,
                    org_repo_name, '', Session)
     # finally commit at latest possible stage
--- a/rhodecode/model/forms.py	Tue Nov 29 09:55:30 2011 +0200
+++ b/rhodecode/model/forms.py	Wed Nov 30 23:11:30 2011 +0200
@@ -603,6 +603,7 @@
         description = UnicodeString(strip=True, min=1, not_empty=True)
         private = StringBoolean(if_missing=False)
         copy_permissions = StringBoolean(if_missing=False)
+        update_after_clone = StringBoolean(if_missing=False)
         fork_parent_id = UnicodeString()
         chained_validators = [ValidForkName(edit, old_data)]
 
--- a/rhodecode/templates/forks/fork.html	Tue Nov 29 09:55:30 2011 +0200
+++ b/rhodecode/templates/forks/fork.html	Wed Nov 30 23:11:30 2011 +0200
@@ -67,7 +67,15 @@
                 <div class="checkboxes">
                     ${h.checkbox('copy_permissions',value="True")}
                 </div>
-             </div>             
+             </div>      
+            <div class="field">
+                <div class="label label-checkbox">
+                    <label for="private">${_('Update after clone')}:</label>
+                </div>
+                <div class="checkboxes">
+                    ${h.checkbox('update_after_clone',value="True")}
+                </div>
+             </div>                       
 	        <div class="buttons">
 	          ${h.submit('',_('fork this repository'),class_="ui-button")}
 	        </div>