hooks are failing when run from plain hg

Issue #801 new
Mads Kiilerich created an issue

For instance http://stackoverflow.com/questions/14211261/how-to-force-rhodecode-to-invalidate-cache-after-push-via-ssh hints that something like

incoming.rhodecode = python:rhodecode.lib.hooks.log_push_action

should work.

It will however fail with:

calling hook incoming.rhodecode: rhodecode.lib.hooks.log_push_action
error: incoming.rhodecode hook raised an exception: Missing data in repo.ui and os.environ
Traceback (most recent call last):
  File ".../rhodecode-venv/lib/python2.7/site-packages/mercurial-2.5.2-py2.7-linux-x86_64.egg/mercurial/hook.py", line 79, in _pythonhook
    r = obj(ui=ui, repo=repo, hooktype=name, **args)
  File ".../rhodecode/rhodecode/lib/hooks.py", line 242, in log_push_action
    raise Exception('Missing data in repo.ui and os.environ')

If it is supposed to work then it seems like some documentation and code changes are necessary.

If some other method is recommended then it should be mentioned somewhere.

Comments (1)

  1. Marcin Kuzminski repo owner

    I'm now doing some refactoring regarding how extra data needed for hooks is working, after that i will write some docs how to optionally execute RhodeCode hooks from pure hg.

    Marcin Kuzminski

  2. Log in to comment