Mercurial 传出钩子
我希望创建一个 Mercurial 钩子,当我推送到本地存储库时,该钩子会推送到备份远程存储库。我以为我可以挂钩“传出”挂钩,但这会创建一个不漂亮的无限循环。那么是否有一个后推送钩子,或者最好让我推送的存储库有一个“传入”钩子来将其推送到远程备份?
I'm looking to create a Mercurial hook that pushes to a backup remote repository when I push to a local repository. I thought I could hook the 'outgoing' hook, but this creates a infinite loop that isn't pretty. So is there like a post-push hook, or would it be best to have the repository I am pushing to have an 'incoming' hook to push the to the remote backup instead?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
每个核心命令 (X) 确实存在一个
post-X
和pre-X
挂钩。也就是说,如果目标是创建本地目标存储库的远程备份,我会在本地目标存储库上的“changegroup”挂钩中执行此操作。
过去解决这个问题时,我只是设置了 cron 作业来定期从本地推送到备份,这可能会滞后很大,但不会让推送用户等待推送(钩子在进程中执行)前景)。
There does exist a
post-X
andpre-X
hook for every core command (X).That said, if the goal is to create a remote backup of the local destination repository, I would do it in a 'changegroup' hook on the local destination repository.
When solving this problem in the past I've just set up cron jobs to do a push from local to backup periodically, which might lag a big, but doesn't leave the pushing user waiting for the push (hooks are executed in process in the foreground).