##// END OF EJS Templates
fixes #834 hooks error on remote pulling
marcink -
r3878:7d29355d beta
parent child Browse files
Show More
@@ -436,7 +436,8 b' class ScmModel(BaseModel):'
436 self.sa.add(repo)
436 self.sa.add(repo)
437 return repo
437 return repo
438
438
439 def _handle_rc_scm_extras(self, username, repo_name, repo_alias):
439 def _handle_rc_scm_extras(self, username, repo_name, repo_alias,
440 action=None):
440 from rhodecode import CONFIG
441 from rhodecode import CONFIG
441 from rhodecode.lib.base import _get_ip_addr
442 from rhodecode.lib.base import _get_ip_addr
442 try:
443 try:
@@ -450,7 +451,7 b' class ScmModel(BaseModel):'
450 extras = {
451 extras = {
451 'ip': _get_ip_addr(environ),
452 'ip': _get_ip_addr(environ),
452 'username': username,
453 'username': username,
453 'action': 'push_local',
454 'action': action or 'push_local',
454 'repository': repo_name,
455 'repository': repo_name,
455 'scm': repo_alias,
456 'scm': repo_alias,
456 'config': CONFIG['__file__'],
457 'config': CONFIG['__file__'],
@@ -504,7 +505,10 b' class ScmModel(BaseModel):'
504 if repo.alias == 'git':
505 if repo.alias == 'git':
505 repo.fetch(clone_uri)
506 repo.fetch(clone_uri)
506 else:
507 else:
508 self._handle_rc_scm_extras(username, dbrepo.repo_name,
509 repo.alias, action='push_remote')
507 repo.pull(clone_uri)
510 repo.pull(clone_uri)
511
508 self.mark_for_invalidation(repo_name)
512 self.mark_for_invalidation(repo_name)
509 except Exception:
513 except Exception:
510 log.error(traceback.format_exc())
514 log.error(traceback.format_exc())
General Comments 0
You need to be logged in to leave comments. Login now