What an easy way to get current svn version in C ++ visual studio application

Is there any easy way to access the SVN repository number and save it in a C ++ line in a C ++ visual studio application?

Thanks for your help in advance!

+5
source share
1 answer

If you have a turtle SVN, you can use SubWCRev.exe

Create a file with the name:

RevisionInfo.tmpl

int SvnRevision = $WCREV$;

Then run the following command:

SubWCRev.exe . RevisionInfo.tmpl RevisionInfo.cpp

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

int SvnRevision = 5000;

From other files, just do something like:

extern int SvnRevision; to access the global variable from within this file.

You can also use SvnRev

+8

All Articles