开发者

Mercurial update source code with current revision numer

开发者 https://www.devze.com 2023-02-05 06:10 出处:网络
I there a way to update a source code file with the current revision number each time i do a commit?

I there a way to update a source code file with the current revision number each time i do a commit? Something like, let's say that in my footer.ph开发者_运维百科p i have something like

Rev. number: {REVISION} 

And when i commit {REVISION} will be replaced with current revision number. I'm using TortoiseHG


You can use RCS-type keyword expansion: https://www.mercurial-scm.org/wiki/KeywordPlan

But if your last changeset didn't include footer.php, then the keywords won't be expanded, so your probably better off having some build procedure write the current revision ID via hg id. There's an example on how to do this in the link above.

0

精彩评论

暂无评论...
验证码 换一张
取 消