Show More
@@ -27,6 +27,7 b' import os' | |||||
27 | import logging |
|
27 | import logging | |
28 | import traceback |
|
28 | import traceback | |
29 | import shutil |
|
29 | import shutil | |
|
30 | import datetime | |||
30 |
|
31 | |||
31 | from rhodecode.lib.utils2 import LazyProperty |
|
32 | from rhodecode.lib.utils2 import LazyProperty | |
32 |
|
33 | |||
@@ -126,12 +127,18 b' class ReposGroupModel(BaseModel):' | |||||
126 | paths = os.sep.join(paths) |
|
127 | paths = os.sep.join(paths) | |
127 |
|
128 | |||
128 | rm_path = os.path.join(self.repos_path, paths) |
|
129 | rm_path = os.path.join(self.repos_path, paths) | |
|
130 | log.info("Removing group %s" % (rm_path)) | |||
|
131 | # delete only if that path really exists | |||
129 | if os.path.isdir(rm_path): |
|
132 | if os.path.isdir(rm_path): | |
130 | # delete only if that path really exists |
|
|||
131 | if force_delete: |
|
133 | if force_delete: | |
132 | shutil.rmtree(rm_path) |
|
134 | shutil.rmtree(rm_path) | |
133 | else: |
|
135 | else: | |
134 | os.rmdir(rm_path) # this raises an exception when there are still objects inside |
|
136 | #archive that group` | |
|
137 | _now = datetime.datetime.now() | |||
|
138 | _ms = str(_now.microsecond).rjust(6, '0') | |||
|
139 | _d = 'rm__%s_GROUP_%s' % (_now.strftime('%Y%m%d_%H%M%S_' + _ms), | |||
|
140 | group.name) | |||
|
141 | shutil.move(rm_path, os.path.join(self.repos_path, _d)) | |||
135 |
|
142 | |||
136 | def create(self, group_name, group_description, parent=None, just_db=False): |
|
143 | def create(self, group_name, group_description, parent=None, just_db=False): | |
137 | try: |
|
144 | try: |
@@ -40,6 +40,7 b'' | |||||
40 | ## REPO GROUPS |
|
40 | ## REPO GROUPS | |
41 |
|
41 | |||
42 | % for gr in c.groups: |
|
42 | % for gr in c.groups: | |
|
43 | <% gr_cn = gr.repositories.count() %> | |||
43 | <tr> |
|
44 | <tr> | |
44 | <td> |
|
45 | <td> | |
45 | <div style="white-space: nowrap"> |
|
46 | <div style="white-space: nowrap"> | |
@@ -48,10 +49,10 b'' | |||||
48 | </div> |
|
49 | </div> | |
49 | </td> |
|
50 | </td> | |
50 | <td>${gr.group_description}</td> |
|
51 | <td>${gr.group_description}</td> | |
51 |
<td><b>${gr |
|
52 | <td><b>${gr_cn}</b></td> | |
52 | <td> |
|
53 | <td> | |
53 | ${h.form(url('repos_group', id=gr.group_id),method='delete')} |
|
54 | ${h.form(url('repos_group', id=gr.group_id),method='delete')} | |
54 |
${h.submit('remove_%s' % gr.name,_('delete'),class_="delete_icon action_button",onclick="return confirm('"+ |
|
55 | ${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)+"');")} | |
55 | ${h.end_form()} |
|
56 | ${h.end_form()} | |
56 | </td> |
|
57 | </td> | |
57 | </tr> |
|
58 | </tr> |
General Comments 0
You need to be logged in to leave comments.
Login now