Question

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?

Was it helpful?

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.

OTHER TIPS

Make your changes on the master "secret". If they are then others won't see them when they pull.

Either add this to you .hgrc on the master:

[phases]
new-commit=secret

or if you don't want every commit to be secret, just the odd one or two, use...

$ hg commit --config phases.new-commit=secret

When you want to make the change public, change it's 'phase' to public.

$ hg phase --public -r <revision>

If phases are new to you I suggest reading this three part series (2) (3) and hg help phases

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top