本文介绍了Mercurial中的自定义修订属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我可以为我的hg存储库设置一个自定义属性,以便我可以存储/检索每个修订版的值?就像东京的天气在提交时等等。
同样的git?
解决方案这可能是一个工作:
- Mercurial中的预提交钩子(不是,它在发生内部提交之前运行,当提交的文件列表是但是pre-commit是一个在提交开始之前运行的通用钩子)
- 一个git预提交钩子(但是你 )
在这两种情况下,所述钩子都会得到您需要的信息并更新一个负责保留该属性的特定文件。 p>
Can I setup a custom property for my hg repository so that I could store/retrieve its value for each revision? Like, weather in Tokyo at the time of commit, etc.
Same for git?
解决方案
This could be a job for:
- a pre-commit hook in Mercurial (not a precommit hook which runs before the internal commit occurs, when the list of files to commit is already known. But "pre-commit", a generic hook which runs before the commit begin)
- a git pre-commit hook (but you need to add your file with the updated weather information to the list of files to be committed)
In both cases, said hooks would get the information you need and update one specific file in charge of keeping that property.
这篇关于Mercurial中的自定义修订属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-23 23:52