Mercurial HGRC 强制忽略默认值

发布于 2024-10-16 01:13:27 字数 186 浏览 0 评论 0原文

我和我团队中的许多开发人员经常遇到 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

向日葵 2024-10-23 01:13:27

一种解决方案是让人们从他们无法推送到的存储库进行克隆。您可以使用存储库的 .hg/hgrc 文件中的 allow_push 指令来限制向您的团队负责人、发布经理等推送。这是一个非常常见的工作流程,其中更改流动例如:

  • 开发人员:从 SHARED 克隆
  • 开发人员:在本地工作
  • 开发人员:推送到 READY_FOR_REVIEW
  • 引导:从 READY_FOR_REVIEW 推送到 SHARED

开发人员仍然可以相互推/拉,但“共享”会受到更多监督。

或者,您可以强制要求人们使用克隆后钩子,该钩子执行以下操作:

[hooks]
post-clone.stopit = perl -ine 'print unless /default = /'

如果您可以控制他们工作的系统,则可以将其放入 /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:

  • developer: clone from SHARED
  • developer: work locally
  • developer: push to READY_FOR_REVIEW
  • lead: push from READY_FOR_REVIEW to SHARED

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:

[hooks]
post-clone.stopit = perl -ine 'print unless /default = /'

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文