I’ve setup a simple changegroup hook for my Mercurial repositories to email the set of changes to interested users. I’d like to use a single script for every repository I manage, and I would also like to identify the repository the changegroup came from. According to the Mercurial Hooks documentation, the environment variable HG_URL is available for this purpose. However, I am not getting what I’m expecting from this variable:
expected:
https://repo01/hg/project
actual:
remote:https::rnideffer
Why is this the URL, and how do I get what I expected into the changegroup hook?
The
changegrouphook can’t always tell the remote URL being used. From the Hooks chapter of the Mercurial Book:So you’re being told they’re pushing via https from a machine named rnideffer.
Have you considered using the notify extension? It ships with mercurial, does pretty much exactly what you’re describing, and can be provided with the URL prefix necessary to turn repo names into the URLs you want.