##// END OF EJS Templates
feat(git/svn): remove filesystem modifications from git/svn calls. When sharding comes in place we can't do this....
super-admin -
r5216:07778025 default
parent child Browse files
Show More
@@ -150,8 +150,7 b' class GitRepository(BaseRepository):'
150 bare=False):
150 bare=False):
151 if create and os.path.exists(self.path):
151 if create and os.path.exists(self.path):
152 raise RepositoryError(
152 raise RepositoryError(
153 "Cannot create repository at %s, location already exist"
153 f"Cannot create repository at {self.path}, location already exist")
154 % self.path)
155
154
156 if bare and do_workspace_checkout:
155 if bare and do_workspace_checkout:
157 raise RepositoryError("Cannot update a bare repository")
156 raise RepositoryError("Cannot update a bare repository")
@@ -162,8 +161,6 b' class GitRepository(BaseRepository):'
162 GitRepository.check_url(src_url, self.config)
161 GitRepository.check_url(src_url, self.config)
163
162
164 if create:
163 if create:
165 os.makedirs(self.path, mode=0o755)
166
167 if bare:
164 if bare:
168 self._remote.init_bare()
165 self._remote.init_bare()
169 else:
166 else:
@@ -179,8 +176,7 b' class GitRepository(BaseRepository):'
179 else:
176 else:
180 if not self._remote.assert_correct_path():
177 if not self._remote.assert_correct_path():
181 raise RepositoryError(
178 raise RepositoryError(
182 'Path "%s" does not contain a Git repository' %
179 f'Path "{self.path}" does not contain a Git repository')
183 (self.path,))
184
180
185 # TODO: johbo: check if we have to translate the OSError here
181 # TODO: johbo: check if we have to translate the OSError here
186 except OSError as err:
182 except OSError as err:
@@ -88,8 +88,7 b' class SubversionRepository(base.BaseRepo'
88 def _init_repo(self, create, src_url):
88 def _init_repo(self, create, src_url):
89 if create and os.path.exists(self.path):
89 if create and os.path.exists(self.path):
90 raise RepositoryError(
90 raise RepositoryError(
91 f"Cannot create repository at {self.path}, location already exist"
91 f"Cannot create repository at {self.path}, location already exist")
92 )
93
92
94 if create:
93 if create:
95 self._remote.create_repository(settings.SVN_COMPATIBLE_VERSION)
94 self._remote.create_repository(settings.SVN_COMPATIBLE_VERSION)
@@ -97,7 +96,9 b' class SubversionRepository(base.BaseRepo'
97 src_url = _sanitize_url(src_url)
96 src_url = _sanitize_url(src_url)
98 self._remote.import_remote_repository(src_url)
97 self._remote.import_remote_repository(src_url)
99 else:
98 else:
100 self._check_path()
99 if not self._remote.is_path_valid_repository(self.path):
100 raise VCSError(
101 f'Path "{self.path}" does not contain a Subversion repository')
101
102
102 @CachedProperty
103 @CachedProperty
103 def commit_ids(self):
104 def commit_ids(self):
@@ -243,13 +244,6 b' class SubversionRepository(base.BaseRepo'
243 pass
244 pass
244 return False
245 return False
245
246
246 def _check_path(self):
247 if not os.path.exists(self.path):
248 raise VCSError(f'Path "{self.path}" does not exist!')
249 if not self._remote.is_path_valid_repository(self.path):
250 raise VCSError(
251 'Path "%s" does not contain a Subversion repository' %
252 (self.path, ))
253
247
254 @LazyProperty
248 @LazyProperty
255 def last_change(self):
249 def last_change(self):
General Comments 0
You need to be logged in to leave comments. Login now