##// END OF EJS Templates
made routes verification method based only on paths, since it's much faster and enough
marcink -
r301:752675cd default
parent child Browse files
Show More
@@ -5,7 +5,7 b' may take precedent over the more generic'
5 5 refer to the routes manual at http://routes.groovie.org/docs/
6 6 """
7 7 from routes import Mapper
8 from pylons_app.lib.utils import check_repo as cr
8 from pylons_app.lib.utils import check_repo_fast as cr
9 9
10 10 def make_map(config):
11 11 """Create, configure and return the routes Mapper"""
@@ -53,22 +53,28 b' def check_repo_dir(paths):'
53 53 if not os.path.isdir(os.path.join(*repos_path)):
54 54 raise Exception('Not a valid repository in %s' % paths[0][1])
55 55
56 def check_repo(repo_name, base_path):
56 def check_repo_fast(repo_name, base_path):
57 if os.path.isdir(os.path.join(base_path, repo_name)):return False
58 return True
59
60 def check_repo(repo_name, base_path, verify=True):
57 61
58 62 repo_path = os.path.join(base_path, repo_name)
59 63
60 64 try:
65 if not check_repo_fast(repo_name, base_path):
66 return False
61 67 r = hg.repository(ui.ui(), repo_path)
62 hg.verify(r)
68 if verify:
69 hg.verify(r)
63 70 #here we hnow that repo exists it was verified
64 71 log.info('%s repo is already created', repo_name)
65 72 return False
66 #raise Exception('Repo exists')
67 73 except RepoError:
74 #it means that there is no valid repo there...
68 75 log.info('%s repo is free for creation', repo_name)
69 #it means that there is no valid repo there...
70 76 return True
71
77
72 78 def make_ui(path=None, checkpaths=True):
73 79 """
74 80 A funcion that will read python rc files and make an ui from read options
General Comments 0
You need to be logged in to leave comments. Login now