How to access the current Subversion build number?

前端 未结 16 2160
刺人心
刺人心 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 06:02

    If you have tortoise SVN you can use SubWCRev.exe

    Create a file called:

    RevisionInfo.tmpl

    SvnRevision = $WCREV$;
    

    Then execute this command:

    SubWCRev.exe . RevisionInfo.tmpl RevisionInfo.txt
    

    It will create a file ReivisonInfo.txt with your revision number as follows:

    SvnRevision = 5000;
    

    But instead of using the .txt you could use whatever source file you want, and have access to the reivsion number within your source code.

提交回复
热议问题