Mercurial HGRC 强制忽略默认值
我和我团队中的许多开发人员经常遇到 Mercurial 克隆中默认推/拉位置的行为问题。有没有办法在系统范围内关闭此功能? IE,我从 ~/abc/123 克隆,然后输入“hg Push”,但我没有推送到该目录,而是收到某种错误消息,例如“对不起戴夫,我不能这样做。”
我仍然想要添加到特定存储库的 hgrc 中的命名位置,我只想关闭默认值。
I and many of the developers on my team are constantly getting into trouble with the behavior of the default push/pull location in mercurial clones. Is there a way to turn this off system wide? I.E., I clone from ~/abc/123, and I type "hg push", and instead of pushing to that directory I get some kind of error message, like, "Sorry Dave, I can't do that."
I still want named locations that I add to the hgrc of a particular repo, I just want the default turned off.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
一种解决方案是让人们从他们无法推送到的存储库进行克隆。您可以使用存储库的
.hg/hgrc
文件中的allow_push
指令来限制向您的团队负责人、发布经理等推送。这是一个非常常见的工作流程,其中更改流动例如:开发人员仍然可以相互推/拉,但“共享”会受到更多监督。
或者,您可以强制要求人们使用克隆后钩子,该钩子执行以下操作:
如果您可以控制他们工作的系统,则可以将其放入
/etc/mercurial/hgrc
,但是共享存储库上的访问控制比在每个人的系统上设置某些内容要容易得多。One solution is to have people clone from a repository to which they cannot push. You can use the
allow_push
directive in the repository's.hg/hgrc
file to limit pushes to your team lead, release manager, etc. That's a very common workflow, where changes flow like:Developers can still push/pull from one another, but 'SHARED' gets a little more oversight.
Alternately, you could mandate that people use a post-clone hook that does something like:
which, if you have control of the systems on which they work, you could put in
/etc/mercurial/hgrc
, but access controls on the shared repo are much easier than setting up something on everyone's system.