##// END OF EJS Templates
fixed issue with db transaction when filesystem creation of repository failed...
marcink -
r1028:f42ee60e beta
parent child Browse files
Show More
@@ -211,21 +211,22 b' class RepoModel(BaseModel):'
211 211 .filter(Permission.permission_name == default_perm)\
212 212 .one().permission_id
213 213
214 repo_to_perm.repository_id = new_repo.repo_id
214 repo_to_perm.repository = new_repo
215 215 repo_to_perm.user_id = UserModel(self.sa)\
216 216 .get_by_username('default', cache=False).user_id
217 217
218 218 self.sa.add(repo_to_perm)
219
220 if not just_db:
221 self.__create_repo(repo_name, form_data['repo_type'])
222
219 223 self.sa.commit()
220 224
221
222 225 #now automatically start following this repository as owner
223 226 from rhodecode.model.scm import ScmModel
224 227 ScmModel(self.sa).toggle_following_repo(new_repo.repo_id,
225 228 cur_user.user_id)
226 229
227 if not just_db:
228 self.__create_repo(repo_name, form_data['repo_type'])
229 230 except:
230 231 log.error(traceback.format_exc())
231 232 self.sa.rollback()
@@ -185,11 +185,13 b' class ScmModel(BaseModel):'
185 185
186 186 try:
187 187 alias = get_scm(repo_path)[0]
188
189 188 log.debug('Creating instance of %s repository', alias)
190 189 backend = get_backend(alias)
191 190 except VCSError:
192 191 log.error(traceback.format_exc())
192 log.error('Perhaps this repository is in db and not in filesystem'
193 'run rescan repositories with "destroy old data "'
194 'option from admin panel')
193 195 return
194 196
195 197 if alias == 'hg':
General Comments 0
You need to be logged in to leave comments. Login now