Search code examples
version-controlmercurialmercurial-hook

Mercurial hook, when others pull


I have a central master repository and several working copies.

The working copies pull from the master and I need to do some work with the master at this moment. So, I would like to have a hook, that gets triggered whenever another repository pulls or tries to pull (=nothing new available) from a repository.

I tried preoutgoing, but this is only triggered, if there are some outgoing changesets available.

How could I solve this problem on the master repository side?


Solution

  • For local file access you're out of luck. Over http you should be able to snag it at the http level in your web server. One usually has apache or nginx or gunicorn or some other wsgi container in front of hgweb and you can run code on GETs to the script.

    You're right that the outgoing hook is only triggered if there are changes that will be sent.