How to access the current Subversion build number?

前端 未结 16 2174
刺人心
刺人心 2020-11-27 05:43

How can you automatically import the latest build/revision number in subversion?

The goal would be to have that number visible on your webpage footer like SO does.

16条回答
  •  日久生厌
    2020-11-27 05:55

    Add svn:keywords to the SVN properties of the source file:

    svn:keywords Revision
    

    Then in the source file include:

    private const string REVISION = "$Revision$";
    

    The revision will be updated with the revision number at the next commit to (e.g.) "$Revision: 4455$". You can parse this string to extract just the revision number.

提交回复
热议问题