##// END OF EJS Templates
svn: simplify the repositroy existing check....
marcink -
r258:78bfa6d7 stable
parent child Browse files
Show More
@@ -17,6 +17,7 b''
17
17
18 from __future__ import absolute_import
18 from __future__ import absolute_import
19
19
20 import os
20 from urllib2 import URLError
21 from urllib2 import URLError
21 import logging
22 import logging
22 import posixpath as vcspath
23 import posixpath as vcspath
@@ -89,6 +90,8 b' class SubversionFactory(RepoFactory):'
89 repo = svn.repos.create(path, "", "", None, fs_config)
90 repo = svn.repos.create(path, "", "", None, fs_config)
90 else:
91 else:
91 repo = svn.repos.open(path)
92 repo = svn.repos.open(path)
93
94 log.debug('Got SVN object: %s', repo)
92 return repo
95 return repo
93
96
94 def repo(self, wire, create=False, compatible_version=None):
97 def repo(self, wire, create=False, compatible_version=None):
@@ -138,6 +141,14 b' class SvnRemote(object):'
138 return True
141 return True
139
142
140 def is_path_valid_repository(self, wire, path):
143 def is_path_valid_repository(self, wire, path):
144
145 # NOTE(marcink): short circuit the check for SVN repo
146 # the repos.open might be expensive to check, but we have one cheap
147 # pre condition that we can use, to check for 'format' file
148
149 if not os.path.isfile(os.path.join(path, 'format')):
150 return False
151
141 try:
152 try:
142 svn.repos.open(path)
153 svn.repos.open(path)
143 except svn.core.SubversionException:
154 except svn.core.SubversionException:
General Comments 0
You need to be logged in to leave comments. Login now