Mercurial:如果子存储库脏了,则阻止提交?
如果存储库有脏的子存储库,是否有任何简单的方法可以防止提交到存储库?
当子存储库意外地与父存储库一起提交时,这真的很烦人。
Is there any simple way to prevent commits to a repository if it has dirty subrepos?
It's really annoying when a subrepo is accidentally committed along with a parent repository.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道你的 simple 行在哪里,但你可以做这样的钩子:
将其保存在
~/bin/dirtysubrepos
中,然后将其添加到你的~/.hgrc
:免责声明:此代码从未在除此文本框之外的任何地方输入过,因此几乎可以肯定它存在语法错误。
I don't know where your line for simple lands but you could do a hook like this:
Save that in something like
~/bin/dirtysubrepos
and then add this to your~/.hgrc
:Disclaimer: This code has never been typed anywhere except this textbox, so it almost certainly has syntax bugs.
由于某种原因,我无法对 Ry4an 的答案发表评论(没有可供我点击的“添加评论”链接),但他的答案中有一个小错字:有一个
${subrepo$$.hg}
应该是${subrepo%%.hg}
。I can't comment on Ry4an's answer for some reason (no "Add comment" link for me to click on), but there's a minor typo in his answer: there's an
${subrepo$$.hg}
that should be${subrepo%%.hg}
.