Changeset - 08f89c688592
[Not reviewed]
beta
0 2 0
Marcin Kuzminski - 13 years ago 2012-10-26 00:13:55
marcin@python-works.com
deleting a group now does same archive operation like deleting repositories. Improve prompt that show number of repos that will
be archived together with a group.
2 files changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/repos_group.py
Show inline comments
 
@@ -27,6 +27,7 @@ import os
 
import logging
 
import traceback
 
import shutil
 
import datetime
 

	
 
from rhodecode.lib.utils2 import LazyProperty
 

	
 
@@ -126,12 +127,18 @@ class ReposGroupModel(BaseModel):
 
        paths = os.sep.join(paths)
 

	
 
        rm_path = os.path.join(self.repos_path, paths)
 
        log.info("Removing group %s" % (rm_path))
 
        # delete only if that path really exists
 
        if os.path.isdir(rm_path):
 
            # delete only if that path really exists
 
            if force_delete:
 
                shutil.rmtree(rm_path)
 
            else:
 
                os.rmdir(rm_path)  # this raises an exception when there are still objects inside
 
                #archive that group`
 
                _now = datetime.datetime.now()
 
                _ms = str(_now.microsecond).rjust(6, '0')
 
                _d = 'rm__%s_GROUP_%s' % (_now.strftime('%Y%m%d_%H%M%S_' + _ms),
 
                                          group.name)
 
                shutil.move(rm_path, os.path.join(self.repos_path, _d))
 

	
 
    def create(self, group_name, group_description, parent=None, just_db=False):
 
        try:
rhodecode/templates/admin/repos_groups/repos_groups_show.html
Show inline comments
 
@@ -40,6 +40,7 @@
 
                ## REPO GROUPS
 

	
 
                % for gr in c.groups:
 
                    <% gr_cn = gr.repositories.count() %>
 
                  <tr>
 
                      <td>
 
                          <div style="white-space: nowrap">
 
@@ -48,10 +49,10 @@
 
                          </div>
 
                      </td>
 
                      <td>${gr.group_description}</td>
 
                      <td><b>${gr.repositories.count()}</b></td>
 
                      <td><b>${gr_cn}</b></td>
 
		               <td>
 
		                 ${h.form(url('repos_group', id=gr.group_id),method='delete')}
 
		                   ${h.submit('remove_%s' % gr.name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+_('Confirm to delete this group: %s') % gr.name+"');")}
 
		                   ${h.submit('remove_%s' % gr.name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+ungettext('Confirm to delete this group: %s with %s repository','Confirm to delete this group: %s with %s repositories',gr_cn) % (gr.name,gr_cn)+"');")}
 
		                 ${h.end_form()}
 
		               </td>
 
                  </tr>
0 comments (0 inline, 0 general)