Mercurial > kallithea
comparison rhodecode/model/repos_group.py @ 1818:cf51bbfb120e beta
auto white-space removal
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Thu, 29 Dec 2011 07:35:51 +0200 |
parents | 48d4fcf04a29 |
children | 89efedac4e6c |
comparison
equal
deleted
inserted
replaced
1817:523b1011a625 | 1818:cf51bbfb120e |
---|---|
66 os.makedirs(create_path) | 66 os.makedirs(create_path) |
67 | 67 |
68 def __rename_group(self, old, new): | 68 def __rename_group(self, old, new): |
69 """ | 69 """ |
70 Renames a group on filesystem | 70 Renames a group on filesystem |
71 | 71 |
72 :param group_name: | 72 :param group_name: |
73 """ | 73 """ |
74 | 74 |
75 if old == new: | 75 if old == new: |
76 log.debug('skipping group rename') | 76 log.debug('skipping group rename') |
90 shutil.move(old_path, new_path) | 90 shutil.move(old_path, new_path) |
91 | 91 |
92 def __delete_group(self, group): | 92 def __delete_group(self, group): |
93 """ | 93 """ |
94 Deletes a group from a filesystem | 94 Deletes a group from a filesystem |
95 | 95 |
96 :param group: instance of group from database | 96 :param group: instance of group from database |
97 """ | 97 """ |
98 paths = group.full_path.split(RepoGroup.url_sep()) | 98 paths = group.full_path.split(RepoGroup.url_sep()) |
99 paths = os.sep.join(paths) | 99 paths = os.sep.join(paths) |
100 | 100 |
134 | 134 |
135 self.sa.add(repos_group) | 135 self.sa.add(repos_group) |
136 | 136 |
137 self.__rename_group(old_path, new_path) | 137 self.__rename_group(old_path, new_path) |
138 | 138 |
139 # we need to get all repositories from this new group and | 139 # we need to get all repositories from this new group and |
140 # rename them accordingly to new group path | 140 # rename them accordingly to new group path |
141 for r in repos_group.repositories: | 141 for r in repos_group.repositories: |
142 r.repo_name = r.get_new_name(r.just_name) | 142 r.repo_name = r.get_new_name(r.just_name) |
143 self.sa.add(r) | 143 self.sa.add(r) |
144 | 144 |