[英]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. 我在我的笔记本电脑上的mercurial存储库中编写代码,然后通过
hg push
其推送到服务器,然后在服务器上运行hg update
,然后在服务器上运行我新编写的代码。 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? 有什么办法可以强制服务器上的repo在我从笔记本电脑上推送到服务器后自动更新到最新版本,这样我就可以保存这个步骤了吗?
Look at the following entry on HG faq : Any way to 'hg push' and have an automatic 'hg update' on the remote server? 请查看HG常见问题解答中的以下条目: 任何方式'hg push'并在远程服务器上进行自动'hg update'? .
。
As per the Faq, you can use the hooks to automatically call "hg update" after a push 根据常规,您可以使用挂钩在推送后自动调用“hg update”
[hooks]
changegroup = hg update >&2
This goes in .hg/hgrc on the remote repository. 这在远程存储库上的.hg / hgrc中。 Output has to be redirected to stderr (or /dev/null), because stdout is used for the data stream.
输出必须重定向到stderr(或/ dev / null),因为stdout用于数据流。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.