Mercurial > kallithea
comparison rhodecode/model/repo.py @ 1505:bb6ba7442293 beta
Fixed methods for checking if path in routes is a repo
added method for checking if path in route is a repos_group
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 01 Oct 2011 19:05:47 +0300 |
parents | 7592484e84d3 |
children | 7d687ed11929 |
comparison
equal
deleted
inserted
replaced
1504:ed3254ac279b | 1505:bb6ba7442293 |
---|---|
299 :param repo_name: | 299 :param repo_name: |
300 :param alias: | 300 :param alias: |
301 :param parent_id: | 301 :param parent_id: |
302 :param clone_uri: | 302 :param clone_uri: |
303 """ | 303 """ |
304 from rhodecode.lib.utils import check_repo | 304 from rhodecode.lib.utils import check_repo_fast |
305 | 305 |
306 if new_parent_id: | 306 if new_parent_id: |
307 paths = Group.get(new_parent_id).full_path.split(Group.url_sep()) | 307 paths = Group.get(new_parent_id).full_path.split(Group.url_sep()) |
308 new_parent_path = os.sep.join(paths) | 308 new_parent_path = os.sep.join(paths) |
309 else: | 309 else: |
310 new_parent_path = '' | 310 new_parent_path = '' |
311 | 311 |
312 repo_path = os.path.join(*map(lambda x:safe_str(x), | 312 repo_path = os.path.join(*map(lambda x:safe_str(x), |
313 [self.repos_path, new_parent_path, repo_name])) | 313 [self.repos_path, new_parent_path, repo_name])) |
314 | 314 |
315 if check_repo(repo_path, self.repos_path): | 315 if check_repo_fast(repo_path, self.repos_path) is False: |
316 log.info('creating repo %s in %s @ %s', repo_name, repo_path, | 316 log.info('creating repo %s in %s @ %s', repo_name, repo_path, |
317 clone_uri) | 317 clone_uri) |
318 backend = get_backend(alias) | 318 backend = get_backend(alias) |
319 | 319 |
320 backend(repo_path, create=True, src_url=clone_uri) | 320 backend(repo_path, create=True, src_url=clone_uri) |