I am writing code in a mercurial repository on my laptop, which I then push to a server via hg push
, and then on the server, I run hg update
and then run my newly-written code on the server. Is there any way to force the repo on the server to be automatically updated to the latest revision after I push to it from my laptop, so I can save the step?
Look at the following entry on HG faq : Any way to 'hg push' and have an automatic 'hg update' on the remote server?.
As per the Faq, you can use the hooks to automatically call "hg update" after a push
[hooks] changegroup = hg update >&2
This goes in .hg/hgrc on the remote repository. Output has to be redirected to stderr (or /dev/null), because stdout is used for the data stream.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With