##// END OF EJS Templates
tasks: updated sync_repo task to use repoid instead of name that can change.
marcink -
r2433:f080a5b4 default
parent child Browse files
Show More
@@ -266,16 +266,18 b' def create_repo_fork(form_data, cur_user'
266
266
267
267
268 @async_task(ignore_result=True)
268 @async_task(ignore_result=True)
269 def sync_repo(*args, **kwargs):
269 def sync_repo(username, repoid):
270 from rhodecode.model.scm import ScmModel
270 from rhodecode.model.scm import ScmModel
271 log = get_logger(sync_repo)
271 log = get_logger(sync_repo)
272 repo_name = kwargs['repo_name']
272
273 log.info('Pulling from %s', repo_name)
273 repo = Repository.get_by_id_or_repo_name(repoid)
274 dbrepo = Repository.get_by_repo_name(repo_name)
274
275 if dbrepo and dbrepo.clone_uri:
275 if repo and repo.clone_uri:
276 ScmModel().pull_changes(kwargs['repo_name'], kwargs['username'])
276 repo_name = repo.repo_name
277 log.info('Pulling from repository `%s`', repo_name)
278 ScmModel().pull_changes(repo, username)
277 else:
279 else:
278 log.debug('Repo `%s` not found or without a clone_url', repo_name)
280 log.debug('Repo `%s` not found or without a clone_url', repoid)
279
281
280
282
281 @async_task(ignore_result=True)
283 @async_task(ignore_result=True)
General Comments 0
You need to be logged in to leave comments. Login now