开发者

Mercurial update source code with current revision numer

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜