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.
精彩评论