##// END OF EJS Templates
feat(git/svn): ensure both assert repo function for git and svn use caching and only those create dirs....
super-admin -
r1184:86489ea8 default
parent child Browse files
Show More
@@ -961,11 +961,13 b' class GitRemote(RemoteBase):'
961 @reraise_safe_exceptions
961 @reraise_safe_exceptions
962 def init(self, wire):
962 def init(self, wire):
963 repo_path = safe_str(wire['path'])
963 repo_path = safe_str(wire['path'])
964 os.makedirs(repo_path, mode=0o755)
964 pygit2.init_repository(repo_path, bare=False)
965 pygit2.init_repository(repo_path, bare=False)
965
966
966 @reraise_safe_exceptions
967 @reraise_safe_exceptions
967 def init_bare(self, wire):
968 def init_bare(self, wire):
968 repo_path = safe_str(wire['path'])
969 repo_path = safe_str(wire['path'])
970 os.makedirs(repo_path, mode=0o755)
969 pygit2.init_repository(repo_path, bare=True)
971 pygit2.init_repository(repo_path, bare=True)
970
972
971 @reraise_safe_exceptions
973 @reraise_safe_exceptions
@@ -189,13 +189,21 b' class SvnRemote(RemoteBase):'
189 if not os.path.isfile(os.path.join(path, 'format')):
189 if not os.path.isfile(os.path.join(path, 'format')):
190 return False
190 return False
191
191
192 try:
192 cache_on, context_uid, repo_id = self._cache_on(wire)
193 svn.repos.open(path)
193 region = self._region(wire)
194 except svn.core.SubversionException:
194
195 tb = traceback.format_exc()
195 @region.conditional_cache_on_arguments(condition=cache_on)
196 log.debug("Invalid Subversion path `%s`, tb: %s", path, tb)
196 def _assert_correct_path(_context_uid, _repo_id, fast_check):
197 return False
197
198 return True
198 try:
199 svn.repos.open(path)
200 except svn.core.SubversionException:
201 tb = traceback.format_exc()
202 log.debug("Invalid Subversion path `%s`, tb: %s", path, tb)
203 return False
204 return True
205
206 return _assert_correct_path(context_uid, repo_id, True)
199
207
200 @reraise_safe_exceptions
208 @reraise_safe_exceptions
201 def verify(self, wire,):
209 def verify(self, wire,):
General Comments 0
You need to be logged in to leave comments. Login now