##// 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 .filter(Permission.permission_name == default_perm)\
211 .filter(Permission.permission_name == default_perm)\
212 .one().permission_id
212 .one().permission_id
213
213
214 repo_to_perm.repository_id = new_repo.repo_id
214 repo_to_perm.repository = new_repo
215 repo_to_perm.user_id = UserModel(self.sa)\
215 repo_to_perm.user_id = UserModel(self.sa)\
216 .get_by_username('default', cache=False).user_id
216 .get_by_username('default', cache=False).user_id
217
217
218 self.sa.add(repo_to_perm)
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 self.sa.commit()
223 self.sa.commit()
220
224
221
222 #now automatically start following this repository as owner
225 #now automatically start following this repository as owner
223 from rhodecode.model.scm import ScmModel
226 from rhodecode.model.scm import ScmModel
224 ScmModel(self.sa).toggle_following_repo(new_repo.repo_id,
227 ScmModel(self.sa).toggle_following_repo(new_repo.repo_id,
225 cur_user.user_id)
228 cur_user.user_id)
226
229
227 if not just_db:
228 self.__create_repo(repo_name, form_data['repo_type'])
229 except:
230 except:
230 log.error(traceback.format_exc())
231 log.error(traceback.format_exc())
231 self.sa.rollback()
232 self.sa.rollback()
@@ -185,11 +185,13 b' class ScmModel(BaseModel):'
185
185
186 try:
186 try:
187 alias = get_scm(repo_path)[0]
187 alias = get_scm(repo_path)[0]
188
189 log.debug('Creating instance of %s repository', alias)
188 log.debug('Creating instance of %s repository', alias)
190 backend = get_backend(alias)
189 backend = get_backend(alias)
191 except VCSError:
190 except VCSError:
192 log.error(traceback.format_exc())
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 return
195 return
194
196
195 if alias == 'hg':
197 if alias == 'hg':
General Comments 0
You need to be logged in to leave comments. Login now