Can I force a remote hg repo to do hg update after I push to it?
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,开发者_StackOverflow社区 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.
精彩评论