Is there any easy way to access the SVN repository revision number and store it in a c++ string in a c++ visual studio application?
Thanks for your help in advance!
"svn info --show-item revision" will give the current revision to which the current directory is updated.
Subversion, with the command line tool svn, is a revision control system, also known as a source code management system (scm) or a source code control system (sccs). The subversion server maintains a repository, where files are stored in a hierarchy of folders, same as a traditional file system.
If you have tortoise SVN you can use SubWCRev.exe
Create a file called:
RevisionInfo.tmpl
int SvnRevision = $WCREV$;
Then execute this command:
SubWCRev.exe . RevisionInfo.tmpl RevisionInfo.cpp
It will create a file ReivisonInfo.cpp with your revision number as follows:
int SvnRevision = 5000;
From your other files just do something like:
extern int SvnRevision; to access the global variable from within that file.
You could also use SvnRev
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With