Custom revision properties in Mercurial?

后端 未结 2 1146
孤独总比滥情好
孤独总比滥情好 2021-01-22 15:06

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 fo

2条回答
  •  孤城傲影
    2021-01-22 15:22

    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.

提交回复
热议问题