简体   繁体   中英

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, 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM