Mercurial > kallithea
comparison rhodecode/model/repo.py @ 1203:6832ef664673 beta
source code cleanup: remove trailing white space, normalize file endings
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sun, 03 Apr 2011 18:23:15 +0200 |
parents | 143b37b7b4aa |
children | a671db5bdd58 |
comparison
equal
deleted
inserted
replaced
1202:eef9e273347a | 1203:6832ef664673 |
---|---|
2 """ | 2 """ |
3 rhodecode.model.repo | 3 rhodecode.model.repo |
4 ~~~~~~~~~~~~~~~~~~~~ | 4 ~~~~~~~~~~~~~~~~~~~~ |
5 | 5 |
6 Repository model for rhodecode | 6 Repository model for rhodecode |
7 | 7 |
8 :created_on: Jun 5, 2010 | 8 :created_on: Jun 5, 2010 |
9 :author: marcink | 9 :author: marcink |
10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> | 10 :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com> |
11 :license: GPLv3, see COPYING for more details. | 11 :license: GPLv3, see COPYING for more details. |
12 """ | 12 """ |
13 # This program is free software; you can redistribute it and/or | 13 # This program is free software; you can redistribute it and/or |
14 # modify it under the terms of the GNU General Public License | 14 # modify it under the terms of the GNU General Public License |
15 # as published by the Free Software Foundation; version 2 | 15 # as published by the Free Software Foundation; version 2 |
16 # of the License or (at your opinion) any later version of the license. | 16 # of the License or (at your opinion) any later version of the license. |
17 # | 17 # |
18 # This program is distributed in the hope that it will be useful, | 18 # This program is distributed in the hope that it will be useful, |
19 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
21 # GNU General Public License for more details. | 21 # GNU General Public License for more details. |
22 # | 22 # |
23 # You should have received a copy of the GNU General Public License | 23 # You should have received a copy of the GNU General Public License |
24 # along with this program; if not, write to the Free Software | 24 # along with this program; if not, write to the Free Software |
25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | 25 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
26 # MA 02110-1301, USA. | 26 # MA 02110-1301, USA. |
27 import os | 27 import os |
302 | 302 |
303 | 303 |
304 def __create_repo(self, repo_name, alias, clone_uri=False): | 304 def __create_repo(self, repo_name, alias, clone_uri=False): |
305 """ | 305 """ |
306 makes repository on filesystem | 306 makes repository on filesystem |
307 | 307 |
308 :param repo_name: | 308 :param repo_name: |
309 :param alias: | 309 :param alias: |
310 """ | 310 """ |
311 from rhodecode.lib.utils import check_repo | 311 from rhodecode.lib.utils import check_repo |
312 repo_path = os.path.join(self.repos_path, repo_name) | 312 repo_path = os.path.join(self.repos_path, repo_name) |
317 backend(repo_path, create=True, src_url=clone_uri) | 317 backend(repo_path, create=True, src_url=clone_uri) |
318 | 318 |
319 def __rename_repo(self, old, new): | 319 def __rename_repo(self, old, new): |
320 """ | 320 """ |
321 renames repository on filesystem | 321 renames repository on filesystem |
322 | 322 |
323 :param old: old name | 323 :param old: old name |
324 :param new: new name | 324 :param new: new name |
325 """ | 325 """ |
326 log.info('renaming repo from %s to %s', old, new) | 326 log.info('renaming repo from %s to %s', old, new) |
327 | 327 |
336 """ | 336 """ |
337 removes repo from filesystem, the removal is acctually made by | 337 removes repo from filesystem, the removal is acctually made by |
338 added rm__ prefix into dir, and rename internat .hg/.git dirs so this | 338 added rm__ prefix into dir, and rename internat .hg/.git dirs so this |
339 repository is no longer valid for rhodecode, can be undeleted later on | 339 repository is no longer valid for rhodecode, can be undeleted later on |
340 by reverting the renames on this repository | 340 by reverting the renames on this repository |
341 | 341 |
342 :param repo: repo object | 342 :param repo: repo object |
343 """ | 343 """ |
344 rm_path = os.path.join(self.repos_path, repo.repo_name) | 344 rm_path = os.path.join(self.repos_path, repo.repo_name) |
345 log.info("Removing %s", rm_path) | 345 log.info("Removing %s", rm_path) |
346 #disable hg/git | 346 #disable hg/git |